"Here are some portable Bourne shell idioms that I find useful to remember for scripting. The Bourne shell does much more than most users realize, and the ksh and bash extensions are rarely essential. (From the command-line, bash and ksh are vastly more useful.)"
http://billharlan.com/pub/papers/Bourne_shell_idioms.htmlFor example
"
Loop over the elements of a PATH by tokenizing with the character ':'.
IFS=':' ; for dir in $PATH ; do echo $dir ; done
"
No comments:
Post a Comment