07-19-2005
Thanks for the post. Got me running
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I would like to send the output of a line in a ksh script to a file, but I need to name the file using a predefined variable:
ls -l > $MYVAR.arc
But what is the correct syntax for achieving this? I can't seem to find the correct syntax for giving the file an extension.
Any... (8 Replies)
Discussion started by: mandriver
8 Replies
2. Shell Programming and Scripting
I am using a bash script to perform some automated maintenance on files in a directory. When I run the script using $sh -x script.sh <directory> the script works fine. It sets the variable to the oldest file, and continues on. However when I run the script like this $./script.sh <directory>, it... (5 Replies)
Discussion started by: spaceherpe61
5 Replies
3. Shell Programming and Scripting
Hi,
I am trying to set a variable to be used in later scripting, and am having some difficulty. I want to look in a file called scan.info and find the line that says "variable ok". Then I want to cut the number at the beginning of that line and assign that number as a variable so that later... (4 Replies)
Discussion started by: garth6@hotmail.
4 Replies
4. Shell Programming and Scripting
I suppose the easiest way to explain my problem is to show you some code and then show you what the code outputs:
--------------------------------------------------
#!/bin/bash
echo "This line has spaces" > "/tmp/This Filename Has Spaces.txt"
export Foo=$(cat "/tmp/This Filename Has... (4 Replies)
Discussion started by: nrogers64
4 Replies
5. Shell Programming and Scripting
I've searched Google and now this forum. Best guess is my search fu is not good (and it probably isn't). The Google search did bring me here.
Background
I have a number of Korn Shell scripts who all use one of 3 values for an environment variable used in the backup system.
On occasion one or... (8 Replies)
Discussion started by: WolfBrother
8 Replies
6. Shell Programming and Scripting
I have a text file in which you need to identify the number of lines that looks like this:
awk '{x + +} END {print x}' filename
The problem is that I do not know how this data to any variable in which then need to continue to work in a cycle for ..
do not know someone help?
Sorry for my... (4 Replies)
Discussion started by: gizmo16
4 Replies
7. Shell Programming and Scripting
If I have a txt file with
test.txt
somelineoftext
and I want to set that line of text to variable in a script:
so
#!/bin/bash
var=''
becomes
#!/bin/bash
var='somelineoftext' (3 Replies)
Discussion started by: digitalviking
3 Replies
8. Shell Programming and Scripting
Hi All
I am checking for the presence of certain no of files in a directory. Only if the required no of files are present should I continue with my processing.
For e.g. in the temp directory below, there are 4 files of the format sample_aa(bb)(cc)(dd)_test. I need to check the count of these... (17 Replies)
Discussion started by: swasid
17 Replies
9. UNIX for Dummies Questions & Answers
Hi all, I have a file that contains characters. How do I get total of spesific character from that file and save the count to a variable for doing for calculation.
data.txt
1
2
2
2
2
3
3
4
5
6
7
8
5
4
3
4 (5 Replies)
Discussion started by: weslyarfan
5 Replies
10. Shell Programming and Scripting
I want to read properties from a file and print evaluated values of each key.
I am using AIX6.1.
myfile.props
protocol=http
siteA.host=siteAhostname
pageA=pageNameA
siteAURL1=${protocol}:/${siteA.host}/pagea/blabla?v1=32
siteAURL2=${protocol}:/${siteA.host}/${pageA}/blabla?v1=32... (5 Replies)
Discussion started by: kchinnam
5 Replies