Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GAH! Bash script insanity



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





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org