Re: Multi-line do shell script. How?
Re: Multi-line do shell script. How?
- Subject: Re: Multi-line do shell script. How?
- From: Doug McNutt <email@hidden>
- Date: Thu, 22 Apr 2004 06:42:23 -0600
At 00:14 -0400 4/22/04, Graff wrote:
>
Ahh ok. I'm mostly a tcsh person so I'm used to using setenv. I got the "declare" command from the bash man pages and when I tested the command it did give me a listing of all my environment variables so I figured that was it.
bash and sh are links to the same executable module. My understanding is that, when called as sh, bash behaves in a manner compatible with the "original" UNIX shell. Perhaps declare is a bash-only call.
It's still not clear to me just how AppleScript calls "the" shell and what commands and environment variables are actually available. Actually learning sh/bash would probably help. A tech note that says it calls "sh" is precise, but one still wonders "which sh?" when there are user defaults and the English-like nature of AppleScript to consider.
I do know that simply asking Do Shell Script to run a prepared and executable script starting with #!/usr/bin/tcsh will source $HOME/.tcshrc. It does not source any login script. It is easy to prepare a shell script as text and save it. Do Shell Script, for me, rarely does anything more than point to that saved executable which can have all the lines it wants. It matters not whether sh or bash is used by AppleScript.
I am surprised to hear, here, that Do Shell Script doesn't execute .bashrc or whatever it is that does the same thing for sh.
It is certainly true that Do Shell Script starts a new shell each time it is called. You cannot expect a second call to remember environment variables that are set in an earlier call from the same AppleScript. BBEdit worksheets are the only things I know that do that.
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
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.