GAH! Bash script insanity
Kevin D. Clark
kclark at CetaceanNetworks.com
Wed Jan 28 18:14:22 EST 2004
Joshua Pollak writes:
> I guess I want something like:
>
> RESULT=`sed -e s/#.*// ${CONFIG_FILE}` | `awk -F"=" '/${PARAMETER}/ {
> print $2 }' `
I suggest this:
RESULT=`sed -e 's/#.*//' "${CONFIG_FILE}" | awk -F"=" "/${PARAMETER}/ { print \\$2 }"`
I also recommend Perl's Config::Simple module.
Regards,
--kevin
--
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc
More information about the Discuss
mailing list