10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
So first: Sorry if the title is confusing...
I have a script I'm writing with a file with several names in it (some other info - but it's not really pertinent...) - I want to be allow the user to delete certain records, but I ran into a problem I'm not sure how to go about fixing.
If I were... (6 Replies)
Discussion started by: sabster
6 Replies
2. Shell Programming and Scripting
I have a file that has four values on each line and I'd like to give each column a variable name and then use those values in each step of a loop. In bash, I believe you could use a while loop to do this or possibly a cat command, but I am super new to programming and I'm having trouble decoding... (2 Replies)
Discussion started by: ccorder22
2 Replies
3. Shell Programming and Scripting
Hi,
I have this code:
cat file.txt | awk -F, 'NR==1{print $6","$8","$10","$20","$21","$19}' > file.tmp
VAR1=`cat file.tmp | cut -d "," -f1`
VAR2=`cat file.tmp | cut -d "," -f2`
VAR3=`cat file.tmp | cut -d "," -f3`;
VAR4=`cat file.tmp | cut -d "," -f4`;
VAR5=`cat... (1 Reply)
Discussion started by: Tr0cken
1 Replies
4. Shell Programming and Scripting
Hi! This might be a simple thing, but I'm struggling to assign values to variables from the file.
I've the following values stored in the file.. It consists of only two rows..
10
20
I want to assign the first row value to variable "n1" and the second row value to variable "n2"..
That is ... (3 Replies)
Discussion started by: abk07
3 Replies
5. UNIX for Dummies Questions & Answers
Problem
Part 1.
Gather data from linux server and output to a file named data_DDMMYY
Output file must contain the file name and size
Part 2.
Compare todays data_DDMMYY to yesterdays data_DDMMYY and output results to a file named difference_DDMMYY
Output file must show the difference in... (3 Replies)
Discussion started by: Aussiemick
3 Replies
6. Shell Programming and Scripting
I am looking to create a perl script which will take numbers from a simple text file, convert them from decimal to hex, and then rewrite those values in the file or create a new file with the hex numbers(whichever's easier).
My text document for example would be something as simple as
1312... (6 Replies)
Discussion started by: samh785
6 Replies
7. Shell Programming and Scripting
suppose I have a file named abc.txt.The contents of the file is sited below
abc.txt
maitree,test,test3
Using awk command can I store these 3 values in 3 different variable and in one single line command of awk.
suppose variable a b c is there.
I don't want like this
a=`awk -F"," '{print... (2 Replies)
Discussion started by: maitree
2 Replies
8. UNIX for Dummies Questions & Answers
Hello everybody, this is my first post here, I think IŽll be here for a long time :D
I wanted to know how I can assign each single character from a string to an array...
For example, "unix"
I have to set,
array=u
array=n
array=i
array=x
However, that string may change in each... (5 Replies)
Discussion started by: Gartlar
5 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
I have a problem assigning variables to script.I have a script in which i have a while loop now i have to assign some values obtained to an array which will be used later in the script.Can anyone help how to do that.
At present my scrot looks like:
co=0
pco=0
co=`cat /tmp/highcpu... (4 Replies)
Discussion started by: usha rao
4 Replies
10. Shell Programming and Scripting
Hi,
I'm trying to assign the permissions, owner and group of a file to seperate variables, but using
ls -l filename | awk '{print $1 "\t" $3 "\t" $4}'
gives the owner as tom.ja instead of tom.james
Is there any way to expand it so i get the full name, or is there an easier way to get them... (5 Replies)
Discussion started by: olimiles
5 Replies