Differences in output between AppleScript and Terminal
Differences in output between AppleScript and Terminal
- Subject: Differences in output between AppleScript and Terminal
- From: debt <email@hidden>
- Date: Fri, 10 Mar 2017 10:14:41 -0800
I was able to get my AppleScript to successfully talk to my Perl script with the help of everyone here, and I think I understand what the problem was. However, I’ve run into another head scratcher.
AppleScript is ignoring the shebang line of the Perl script.
I'm using perlbrew to set the version of Perl that I want to use because the system Perl is too old. Typing "/usr/bin/env perl" works properly in Terminal, but it doesn't in AppleScript. Here’s what I get from both:
In Terminal: $ /usr/bin/env perl -e 'print "$^V";' v5.24.1
In AppleScript: do shell script "/usr/bin/env perl -e 'print \"$^V\";'" v5.10.1
Since the Perl script is calling for v5.24, the process fails with an error that the Perl called is too old.
I know that shell commands act differently in Terminal than they do in AppleScript, but this one seems like they should both be the same. They’re both using ‘env’ so they both should give the same result, but they don’t. Is there a trick to make AppleScript give the same result as in Terminal in this situation? I don’t want to hard code the Perl version in the AppleScript as then I have to remember to update that every time I update Perl.
Thanks, Marc |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden