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 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.





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