Re: Fink and 'sh'
Re: Fink and 'sh'
- Subject: Re: Fink and 'sh'
- From: Graff <email@hidden>
- Date: Tue, 23 Mar 2004 09:40:33 -0500
On Mar 23, 2004, at 9:07 AM, Doug McNutt wrote:
At 23:18 -0500 3/22/04, Graff wrote:
However when I do:
do shell script "tcsh -c 'echo $PATH'"
I get:
/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/currentuser:/
usr/ X11R6/bin
What's happening is that AppleScript is using bash as a default. It
ignores anything you ask for in your Aqua login preferences. bash then
sees the command line that starts with "tcsh" and starts up a
non-login copy of tcsh which executes - er, sources - $HOME/.tcshrc.
You can see this if you echo $SHLVL for which you will see a value 2
meaning you're two levels deep into shells. Try inserting an echo or
two, redirected as >> $HOME/shellog, into your .tcshrc file to
experiment with all the shelling that goes on.
Well, it's calling /bin/sh but of course on Mac OS X sh is just a copy
of bash that is running in sh-compatability mode. And of course when I
run /bin/tcsh I'm then running a tcsh session inside that sh session,
that goes without saying. This sort of thing I already understand,
it's the actual order of all the levels of initialization scripts that
I'm not clear on.
For example, I've been told that there are scripts that get executed
when you log in remotely, others for local, some for bash, some for
tcsh, etc. I know of .tcshrc, .login, .logout, .xinitrc, cshrc,
.profile, the environment plist in ~/.MacOSX, a ton of files in /etc
that do initialization, and so on. Your head starts to spin after a
while when you try to work out just what the order and circumstances
are for the execution of all these initialization scripts. I mostly
stick to just modifying .tcshrc because I mainly use tcsh but I know
that the other scripts exist for a purpose.
I'd love to know of some sort of central repository where you can find
out just what all these initialization scripts are and just when and
under what circumstances they are run. That way you could plan around
them and maybe even have some sort of sure-fire central place to make
changes that are reflected in all of them.
-Ken
_______________________________________________
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.