Shell Function and $PATH?

Jim Ault JimAultWins at yahoo.com
Fri Feb 3 22:29:23 EST 2006


On 2/3/06 4:42 PM, "David Bovill" <david at openpartnership.net> wrote:

> How does the $PATH and the shell() function work?
> That is the path as you get from:
>      put $PATH
> or
>      put shell("echo $PATH")
> does not correspond with what you get if you try the same from the
> shell. This is presumably because these are set by various bash
> scripts when a terminal starts and Rev does not do this?
> 
> OK - but how does Rev do this exactly, which $PATH does if take, and
> what happens when you set the PATH from inside Revolution - this is
> important as shelling to programs does not work unless they are on
> the PATH.

Part of the answer is that OSX could be starting terminal with a different
shell than you might be thinking, therefore the $PATH def could be
different.  Apple discusses this when using AppleScripting

You might put in a test for this adjusting for the users setup.

Terminal
echo $SHELL =>  /bin/tcsh
echo $PATH => /bin /sbin /usr/bin /usr/sbin

Rev
echo $SHELL =>  /bin/tcsh
put $PATH =>  /usr/bin:/bin:/usr/sbin:/sbin
put shell("echo $PATH")=>  /usr/bin:/bin:/usr/sbin:/sbin

Note the delimiters and the sequence in the Rev path

As far as I know, executing a command from Rev has the same effect as any
command line.  Rev has its own variable space, but system and environment
variables should not part of that.

Try changing something from Rev, the getting in Terminal, etc.

I do not work much with unix, shells, etc, so can't be of much help, but
since it is a late hour for most & Friday night & Superbowl weekend (a
holiday in some parts of the world) I thought I would give a clue or two
that might help you.

Jim Ault
Las Vegas





More information about the use-livecode mailing list