[svlug] bash scripts - config files with comments?

Florin Andrei florin at andrei.myip.org
Tue Aug 21 13:27:29 PDT 2007


Michael Cheselka wrote:
> 
> He's trying to source the file - like an include.

No, sourcing the file is what I was doing at the time I sent the first 
message in this thread.
I don't like sourced up files because they're essentially part of the 
main executable and messing with the executable just to make config 
changes is not a very good idea IMO.

Robert Lanning provided the best metaphor - like /etc/hosts but for 
bash. Essentially an 1-dimensional array of strings that's 
sysadmin-friendly in the normal Unix way.

Robert Citek's example is exactly what I need and works very well - 
lines commented out are ignored, it's tolerant to extraneous blank and 
tab characters, etc.

Probably my fault for not explaining it clearly.

-- 
Florin Andrei

http://florin.myip.org/



More information about the svlug mailing list