GAH! Bash script insanity

Joshua Pollak pardsbane at offthehill.org
Wed Jan 28 17:14:46 EST 2004


On Jan 28, 2004, at 4:56 PM, Dan Barrett wrote:

> On Wednesday 28 January 2004 16:42, Joshua Pollak wrote:
>>
>> Any ideas, besides shooting myself and re-writing this in C or
>> hardcoding everything?
>>
>
>
> Your params file looked like a bash script anyhow, so why not either:
>
> a) put your env variables in the system .bashrc
> b) have everyone append "source config_file_name" to their .bashrcs
> c) have your make system do all of this

Well, this is a fairly rational idea. However, the one issue is that 
each line is prepended by a platform modifier:

win32:PARAMETER=myParam
unix:PARAMETER=myParam

I guess on Unix I could do something like:

sed -e /#.*// user.cfg | sed -e /win32.*// | sed -e /macx.*// | source

would work... can you source stdin? Or would I just execute the output 
of the sed commands? The variables set there wouldn't get exported then 
though....

-Josh

-- 
Bush/Cheney '04:
Thanks for not paying attention.




More information about the Discuss mailing list