[sclug] Suppressing variable subsititution in a bash script

Tim Sutton suttont at onetel.net.uk
Sat Oct 25 09:05:52 UTC 2003


I am trying to do the following in a bash script:

for PID in `ps -ef |grep "java -Djava.security.policy" |awk '{$2}'`;
do
	....
done

Which is not working - I suspect because the $2 in awk'{$2}' is being expanded 
out? How do I suppress this? I tried \$2 but that does not seem to work?

Thanks 

Tim

-- 
Get my public keys from:

http://tim.suttonfamily.co.uk/modules.php?name=Content&pa=showpage&pid=2




More information about the Sclug mailing list