GAH! Bash script insanity

Derek Atkins warlord at MIT.EDU
Wed Jan 28 18:21:09 EST 2004


Joshua Pollak <pardsbane at offthehill.org> writes:

> Ok, I'm going crazy. I don't know how the script-kiddies deal with bash.
>
> So the advice I got from the list re: my awk problem was great, and
> I'm trying to implement it. Here is what I want to run:
>
> sed -e s/#.*// ${CONFIG_FILE} | awk -F"=" '/${PARAMETER}/ { print $2 }'

Try this:

  sed -e 's/#.*//' ${CONFIG_FILE} | awk -F"=" "/${PARAMETER}/ \{ print \$2 \}"

I'm not 100% sure if you need to quote the braces at the end.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the Discuss mailing list