It is currently Tue, 30 Nov 2021 17:24:57 GMT



 
Author Message
 awk and sh variables in a shell script

I have a shell script with the following 2 lines in it (among others):

t=`echo $j | awk -F/ '{print $6}'`;
cat $j | awk '{print "rect ("$2","$3") ("$2+$4","$3+$5") "$name"/ICONTACT
/"$1}' name=$t  >> $j.map;

For some reason when I run this, $name defaults to $0, which gives some
really undesirable output for me.  What I want is to use $t within the awk
script, because those two lines are inside of a "for j...; do...done" loop
which is always changing the value of $j and thus $t.  Please e-mail me, as
I rarely ever get to read news these days.

In case you are wondering, $j above is the name of an imagemap file made by the
aub and icontact program.
--
A SysAdmin Dude - Mentor Graphics Corp, Warren, NJ 07059
   _____/           ____         /        /   ernie_opo...@warren.mentorg.com
_____      ____              _        _       eao...@psuvm.psu.edu
\______/ __    __ \______/ __  \___ __  \___  sh...@psu.edu



 Sat, 28 Jun 1997 00:47:08 GMT   
 
   [ 1 post ] 

Similar Threads

1. awk and sh variables in a shell script

2. help for newbie: way to get the value of an awk variable in a shell script

3. file contents into variable, or global variable from shell script

4. export variables to calling shell in a shell-script


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software