Re: do shell script with administrator privileges & shell commands
Re: do shell script with administrator privileges & shell commands
- Subject: Re: do shell script with administrator privileges & shell commands
- From: garbanzito <email@hidden>
- Date: Wed, 14 Aug 2002 10:46:45 -0600
at 2002 08 13, 22:45 -0700, they whom i call John W Baxter wrote:
At 16:15 -0700 8/13/2002, Chris Espinosa wrote:
2) Environment variables that are set in your user login (like your
$PATH) are not pre-set for 'do shell script', so you may need to
specify explicit paths for some commands (like those in
/Developer/Tools).
To learn where a command is, do (starting in your default shell: tcsh
unless you've changed it):
sh
which nameofcommand
for those who don't know, note that you'll be stuck in this
subshell until you type "exit" at the subshell prompt.. that
will terminate the subshell and bring back the default tcsh
prompt
also, Chris explains the PATH issue in the most general way,
but i think for most scripters the issue boils down to what
exactly is the value of PATH for "do shell script" -- unless
you alter things, it will be the three folders
/usr/bin /bin /Users/(your home folder)
so for example if you want to sue the "ifconfig" command,
and "which" tells you it is located in /sbin, it won't be
found unless issued with the full path:
do shell script "/sbin/ifconfig en0"
(some will recommend a safe habit of using the full path on
*every* command)
--
steve harley
_______________________________________________
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.