|
From: Fmiser <fm...@gm...> - 2013-01-30 09:36:52
|
> > On Jan 29 09:00:16, jr...@co... wrote: > > > > Scripting is certainly a fantastic skill, and opens many > > doors! For scripting on OS X, I'd recommend "man bash" > > rather than "man sh", as the default shell on this platform > > is bash. > Jan Stary wrote: > > scripting 101: use plain sh in your scripts, not bash, > so that your scripts are portable to other UNIX systems, > some of which do not even have bash; sh is everywhere, > and is almost the same everywhere. Scripting 102. Use the best tool for the job. Use bash if it's a better choice than sh. Portability isn't the only factor to consider. And even sh only manages "almost the same", so it isn't 100% portable. So like any other choice, there are compromises and costs. The challenge is evaluating the situation and deciding which is right for a _you_ and your situation. For beginners, I encourage using scripts that match the shell. So if the shell is bash, that would be bash scripts. Some links http://www.linuxfocus.org/English/September2001/article216.shtml http://www.linuxdoc.org/HOWTO/Bash-Prog-Intro-HOWTO.html http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html http://www.davidpashley.com/articles/writing-robust-shell-scripts.html http://tldp.org/LDP/abs/html/ -- Philip |