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



On Jan 28, 2004, at 9:31 PM, Chris Devers wrote:
>
>> I guess I want something like:
>>
>> RESULT=`sed -e s/#.*// ${CONFIG_FILE}` | `awk -F"=" '/${PARAMETER}/ {
>> print $2 }' `
>
> Are you sure?
>
> What if ${PARAMETER}="CMD" (for example), and the file has
>
>     CMD=rm -rf /
>
> ?

This (unless I'm mistaken) doesn't execute the line above. My 
understanding of it is that the value of RESULT will be 'rm -rf /', ie:

echo $RESULT
rm -rf /

which of course might be a bad idea, but doesn't actually execute 
anything.


-- 
Joshua Pollak
Software Engineer
Charles River Analytics
617-491-3474 x586





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