10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am having trouble extracting the value in the columns declared in a variable. I have tried several different variation of awk but both give me the column number and not the actual value of that column.
Any suggestions?
Neither of the "extract" variables below are performing as desired
... (5 Replies)
Discussion started by: ncwxpanther
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I'm doing a script to list all scripts called by a "master" script.
But I have an issue as there is some variables in the name of the called scripts.
Example:
% cat master_script.sh
ENVIR=PROD
VERSION=1.2
/users/maturix/$ENVIR/program_$VERSION.shI would like my script displays a kind... (7 Replies)
Discussion started by: maturix
7 Replies
3. Shell Programming and Scripting
Hi Guys,
I am stuck in a problem.
I have a variable in Perl script which has value for example
X=a-b-c;
Now, I want to extract a b c separately into different 3 variables. I know this can be done in shell using awk but Perl behaves a bit different.
Can anybody help me on this please?... (3 Replies)
Discussion started by: prashant2507198
3 Replies
4. Shell Programming and Scripting
If i wanted to extract the number of collisions from the eth0 section of the ifconfig file and have the output placed in a variable how would i do this?
I can get the output displayed using:
/sbin/ifconfig eth0 | grep "collisions"
What command would i now use to place the output in a... (1 Reply)
Discussion started by: warlock129
1 Replies
5. Shell Programming and Scripting
Hi
I've got phrases (string) in phrases.txt file and I've got script.sh.
How can I draw out the first line from phrases.txt, save it in variable PHRASE and perform the content of script.sh, and then draw out the second line from phrases.txt, save it in the same variable PHRASE and perform the... (4 Replies)
Discussion started by: patrykxes
4 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I'm running calculations and I need to extract a specific number from a output file. So far I've only been able to GREP entire lines containing the string: '1 F=' . I would like to go a step further and extract just the number following '1 F='. The entire line looks like:
1 F=... (10 Replies)
Discussion started by: modey3
10 Replies
7. Shell Programming and Scripting
I have a file named xyz_extract_file_20091201.dat and I need to strip out 20091201 from the file name and append this value as a first field in all the records in the file. Can you please help? Thanks.
Eg.
Input File: xyz_extract_file_20091201.dat
------------
Campaign1,A2347,Grp_id1... (1 Reply)
Discussion started by: shekharaj
1 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I have scenario as below,
I want to cut the characters and store it variable2.. and want to display the variable2.. as shown below...
eg: the size may differs , i am show just an example.....
numbers are not fixed in variable1..i want to extract characters and... (1 Reply)
Discussion started by: G.K.K
1 Replies
9. Shell Programming and Scripting
hi,I am new to shell script,I have String,like this:
Number of rows exported: 5321
the numbe at end could changing,how can I extract this number and assign it to a variable,then use it later in script.
thanks. (19 Replies)
Discussion started by: vitesse
19 Replies
10. Shell Programming and Scripting
Hi,
I know that simple way to do this is var=`echo $line | awk '{print $5}'`
But maybe there is shorter way to do this ?
Also maybe there is some way to assign all fileds from line separated by lets say ":" to some variables
instead of
var1=`echo $line | awk '{print $1}'`
var2=`echo $line... (11 Replies)
Discussion started by: pp56825
11 Replies