No more shell games!
May 31, 2006 5:02 PM
Subscribe
*nix shell "best practices" anyone?
Over the years I've been writing more and more shell scripts (bash, ksh, perl, expect) and they've been getting more and more complexe. I haven't been able to find a comprehensive list of best practices for shell programming although I have learned a lot by looking at other people's scripts (thank you sanity checks!) I'm looking for links or your own best practices.
Here's an example:
Use ${FOO} instead of $FOO so that the variable is more likely to be interpreted when concatenated in a string and use >> "${FOO}" instead of >> ${FOO} in case ${FOO} has spaces in it.
posted by furtive to computers & internet (9 comments total)
9 users marked this as a favorite
posted by russilwvong at 5:11 PM on May 31, 2006