Re: New technote for "do shell script"
Re: New technote for "do shell script"
- Subject: Re: New technote for "do shell script"
- From: Christopher Nebel <email@hidden>
- Date: Tue, 28 Jan 2003 11:07:31 -0800
On Tuesday, January 28, 2003, at 08:48 AM, Doug McNutt wrote:
At 20:22 -0800 1/27/03, Paul Berkowitz wrote:
<http://developer.apple.com/technotes/tn2002/tn2065.html>.
Question 1:
"There are two possibilities: first, do shell script always uses the
sh
shell, not your default shell, which Terminal uses. (The default
shell for
new users is csh, so unless you've changed it, that's what it is.)"
csh? What happened to tcsh?
First off, Paul is correct -- the default for new users is tcsh, not
csh, so I'll get that fixed.
I have a script I use at every login and it ran fine this morning. The
script is 100% tcsh and uses if - end if in a non dislexic fashion
which would surely fail in bash. It' is executed with a "do shell
script". It does begin with #!/bin/tcsh. ... [The tech note is] in
direct conflict with my experiences.
No, it's not. You're saying you've got a file that's marked executable
and starts with "#!/bin/tcsh", right? If you trigger it by saying 'do
shell script "my-login-script"', then what actually happens is this:
1. do shell script launches sh.
2. sh looks at the input "my-login-script" and determines that it's the
name of an executable file.
3. It executes the file.
4. The system notices the "#!" (aka shebang) line, sees that it should
use /bin/tcsh to run the file, and does so.
Once again: "do shell script" always uses sh to interpret its input.
What happens in the commands that input triggers depends on the
commands.
--Chris Nebel
AppleScript Engineering
_______________________________________________
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.