|
From: Jan S. <ha...@st...> - 2013-01-30 10:50:35
|
On Jan 30 03:30:38, fm...@gm... wrote: > > > 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. We are totally OT now of course, but how is bash a better tool for a for-cyclus wrapping a sox call? The actual code is a few trivial lines. Using bash for it instead of sh will make a single difference: you will not be able to run it where bash does not exist. > Portability isn't the only factor to consider. And even sh only > manages "almost the same", so it isn't 100% portable. The differences in various implementations of sh(1) are quite subtle, and only pop up on the very borders of the POSIX specification. Totally not the case here. > 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. Jesus, he wants a for-loop. Restricting to plain sh(1), you lose _nothing_, and gain portability. > For beginners, I encourage using scripts that match the shell. > So if the shell is bash, that would be bash scripts. This, sir, is complete bullshit. |