Which shell?
Which shell?
- Subject: Which shell?
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 03 Dec 2002 11:04:48 -0800
As I understand it, 'do shell script' uses "sh", which is actually an
emulation run by "bash" in OS 10.2, and was run by an old version of "zsh" n
10.1.
I imagine that one day I'll want to do something that can't be done by sh,
and I'll need to invoke one of the other shells to do it, with a "#!" line.
I figure that I might as well get used to the shell I'll want to use then by
switching Terminal over to that shell now. I'll virtually always be figuring
out the shell script in Terminal or in a script file before converting it to
AppleScript use.
So my question is: since bash is the shell in charge of 'do shell script',
is there an advantage to calling bash rather than, say zsh (or tcsh) from
'do shell script', purely from an AppleScript pint of view? Performance,
maybe, not having go through too many different shell calls? Or is there no
particular advantage?
Asking around in Unix places seems to indicate that most Unix adepts like to
use zsh, but also have time for bash. Most of them aren't too keen on tcsh,
the Terminal default. So I figure I should switch over to either zsh or bash
in Terminal, and would like to choose whichever one will be most convenient
if I later have to invoke it in AppleScript. I do realize that if I'm
dealing with a really complex shell script, I can just create a script text
file beginning with a shebang line invoking any shell, perhaps in Temporary
Items folder or elsewhere, and just run it that way. And in AS Studio I can
include such a text file in the Resources in the bundle. And I'm happy to
restrict myself to "OS 10.2 and later" - let's forget about 10.1.
So, does it matter? Will bash run better in 'do shell script' than other
shells will?
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.