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
(5 Replies)
Discussion started by: radioactive9
5 Replies
3. Shell Programming and Scripting
Hi, I have the following command that parses an xml file to read a node <port>'s value. Hoever the output comes with spaces.
My requirement is to trim the spaces around the value and assign to a variable.
sed -n 's|<port>\(.*\)</port>|\1|p' ../cfg.xml
How do I go about it? (6 Replies)
Discussion started by: sai2013
6 Replies
4. Shell Programming and Scripting
Hi all,
I am wondering how can I check when a variable has nothing returned in it. I am trying to store a pid in this variable to see if a script is running in the background. So I am using something like that
proc_pid=`ps -ef |grep script.sh|grep -v grep|awk '{print $2}'`
if
then
... (1 Reply)
Discussion started by: geovas
1 Replies
5. Shell Programming and Scripting
Hi,
In a file old.txt containing (for example) a series..
#limerick There was a young lady from Nantucket..
\images\Blank.jpg
:end
#joke A horse walked into a bar...
\images\Blank.jpg
end
I would like to achieve new.txt containing
#limerick There was a young lady from Nantucket..... (5 Replies)
Discussion started by: Nigel_R
5 Replies
6. Shell Programming and Scripting
can anyone please help me with this:
i have written a shell script and a stored procedure which has one OUT parameter. now i want to use that out parameter as an input to the unix script but i am getting an error as variable not found. below are the unix scripts and stored procedure...
... (4 Replies)
Discussion started by: swap21783
4 Replies
7. Shell Programming and Scripting
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies
8. UNIX for Dummies Questions & Answers
Hello
I am using unix CLI commands for the Synergy CM software. The command basically searches for a folder ID and returns the names of the projects the folder sits in. The result is assigned to a variable:
FIND_USE=`ccm folder -fu -u -f "%name"-"%version" ${FOLDER_ID}`
When the command... (6 Replies)
Discussion started by: Glyn_Mo
6 Replies
9. Shell Programming and Scripting
Hi,
I'm quite new to scripting and I want to modify following line of an existing script:
MYVAR=`subst |grep 'L:\\\:' | sed -e 's/.*\\\//'`;
What I have to do is to use the content of a variable instead of the constant expression 'L:\\\:' as the grep string to be matched.
Assuming I already... (5 Replies)
Discussion started by: snowbiker99
5 Replies
10. Shell Programming and Scripting
Hi,
Can anyone please show me how to assign the returned value of a function to a variable? Thanks. (2 Replies)
Discussion started by: trivektor
2 Replies