Re: Do shell script vs terminal discrepancy
Re: Do shell script vs terminal discrepancy
- Subject: Re: Do shell script vs terminal discrepancy
- From: Bill Briggs <email@hidden>
- Date: Fri, 4 Dec 2009 19:58:15 -0400
At 4:07 PM -0500 12/3/09, Paul Skinner wrote:
>Does anyone know why I'm seeing this discrepancy in behavior?
I'm on a Tiger Mac right now, and there are five different shells available. I'm using "bash" as my shell in Terminal, and AppleScript is using "sh". When you invoke "sh" from AppleScript, it is run by an owner that is NOT you, the logged in user. So there's a different set of ENV settings invoked from those that you have for the Terminal shell, wherein you are the user, and for which you have your own ENV settings. I've had to alter the ENV settings for sh a few times to get the same behaviour out of "do shell scripts" that I had with Terminal.
For example, I wrote a function library for "bc", and I had to add the following line to my ENV settings to get it to load when "bc" is invoked:
BC_ENV_ARGS=-lq /Users/bill/Documents/bc_Lib/funcLib.bc
After that change, you can call "bc" from do shell script and NOT get the functions in the library. The same line has to be added to the /etc/profile file for bc to load the library. So whatever you may be seeing could be related to this.
Not sure if that's the issue on your Mac, but it's worth checking. The escaping of characters is also a possibility, as has been noted.
On my Mac you'd have to add this: /usr/local/bin/ to your ENV file for "convert" to work in Terminal, and in "etc/profile" for it to work in a "do shell script" context.
- web
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden