10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
grdinfo data.grd | awk '{print $10,$5}'| read N L
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
2. Shell Programming and Scripting
My script
----------
for i in `cat n`;do
export k=`echo "CSN: "$i` //combining CSN: and value from n
echo "$k"
awk ''{print "CSN: "$0;}'{_=29}_&&_--' file1|tail -1 >> file2
done
In the above script i cannot able to resolve $k in awk command
file n contains
------------
0000
1111... (0 Replies)
Discussion started by: Mohana29_1988
0 Replies
3. Shell Programming and Scripting
Hi All,
I have below variable,
xyz=\$AI_XFR
Now, if you will run the below command
=> echo $xyz
$AI_XFR
It is returning hardcoded string value.
Whereas in environment, there is value in it. Like below:
=> echo $AI_XFR
/home/aditya/sandbox/xfr/
I need to resolve this... (4 Replies)
Discussion started by: adgangwar
4 Replies
4. Shell Programming and Scripting
Hello Everyone,
I am trying to resolve a variable inside another variable.Let me go straight to the example.
Input:
Query=$Table_1 Join $Table_2
(Query itself is a variable here)
Now for two different cases I am assigning different values to Table_1 and Table_2
Case 1:... (14 Replies)
Discussion started by: vinay4889
14 Replies
5. Shell Programming and Scripting
I am tyring to resolve an environment variable that is part of a string I selected from our database.
Simply put, I want cd to this folder before checking if a file exists.
The variable $in_loc has the value '$PS_HOME/int/VSP' where $PS_HOME is the environment variable.
I am using cd... (6 Replies)
Discussion started by: consult_jb
6 Replies
6. Shell Programming and Scripting
Hi all,
Hope someone can help me out here.
I have this BASH script (see below)
My problem lies with the variable path.
The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level.
The... (6 Replies)
Discussion started by: Cowardly
6 Replies
7. Shell Programming and Scripting
Hi friends,
I have a file list1 which has these 2 columns like
616449 0
434453 1
2151083 0
2226536 0
2132382 0
2136814 0
I have to put the result of col1 -col2 into another file list2 linewise.
e.g. It gives the below result if use the below code:
awk '{ print $1 - $2 }' list1 >... (2 Replies)
Discussion started by: kunwar
2 Replies
8. Shell Programming and Scripting
Hi,
Does awk ever resolve params in the search pattern?..
The following awk doesnt know how to resolve ${tables}$ inside a loop.
k=`awk '/${tables}$/ ${graph}`
The search pattern has ${tables}$ and I am narrowing down my search with a $ at the end of string.
So...this leaves me with a... (13 Replies)
Discussion started by: anduzzi
13 Replies
9. UNIX for Dummies Questions & Answers
awk -F^ '{ if ((($1 != "M") && ($5 != "2")) || (($1 != "S") && ($5 != "7"))) print $0}' welcome > welcome1
The "&&" and "||" in the above command is not working with awk.
When I run the above command, the same content of welcome is copied to welcome1 without any difference.
Your reply is... (12 Replies)
Discussion started by: karthickrn
12 Replies
10. Shell Programming and Scripting
Hi
I have a variable which is a path ie:
UBERROR=/cobwrk/mchr/prodsup/ub/wrk/../error
is there anyway I can get the output of an echo to read:
#echo $UBERROR
/cobwrk/mchr/prodsup/ub/error
instead of
#echo $UBERROR
/cobwrk/mchr/prodsup/ub/wrk/../error
Many thanks! (2 Replies)
Discussion started by: serm
2 Replies