Re: Shell and Perl scripts
Re: Shell and Perl scripts
- Subject: Re: Shell and Perl scripts
- From: Christopher Nebel <email@hidden>
- Date: Sat, 7 May 2005 01:02:15 -0400
On May 6, 2005, at 9:45 PM, Paul FitzGerald wrote:
I can make the [shell] scripts work if I hard code some full paths
but I can't seem to find a way to make them work with default
paths. I have some test scripts (below) that demonstrate the
problem better than I can explain. If I run the shell script from a
terminal window I can make it work since it has a concept of a
current directory. But called from Automator it has issues.
I start with a folder named "xxx" on my desktop and run the shell
script test.sh.
Both the shell script and the perl script are in a folder, also on
my desktop, named "process" along with the Automator workflow.
test.sh
# This mv command works as expected, renaming the folder to the
name passed in as an argv.
mv ~/Desktop/xxx ~/Desktop/$1
# Calling the perl script as below does not work. It can't find the
perl script.
perl test.pl ~/Desktop/$1
# If I use a path to the perl script the script will run and
receive the argv as expected.
perl ~/Desktop/process/test.pl ~/Desktop/$1
Thoughts? anyone?
This is probably the same issue mentioned in TN2065 regarding the
value of PATH. You can check the value by writing a two-action
workflow: Run Shell Script (echo $PATH) > View Results. You'll
probably find that /usr/bin isn't in it, which means you need to use
the full path. (mv works because it's in /bin.)
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden