[sclug] Suppressing variable subsititution in a bash script

Simon Huggins huggie at earth.li
Sat Oct 25 09:05:52 UTC 2003


On Fri, Aug 29, 2003 at 01:57:59PM +0100, Tim Sutton wrote:
> I am trying to do the following in a bash script:
> for PID in `ps -ef |grep "java -Djava.security.policy" |awk '{$2}'`;
> 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?

You mean awk '{print $2}' I think.


-- 
 _        huggie at earth.li      -+*+-     fou, con et anglais      _
(_)                  "The claw is our master."                   (_)
(_)                                                              (_)
  \___                                                        ___/



More information about the Sclug mailing list