Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > do shell script error

do shell script error
Thread Tools
surfacto
Dedicated MacNNer
Join Date: Oct 2001
Location: California
Status: Offline
Reply With Quote
Sep 1, 2003, 03:35 PM
 
When I write the script:

tell application "Terminal"
activate
do script "/bin/sh
cd /workingdirectory
flic.command
exit"
end tell

it opens Terminal and runs flic.command perfectly.

However, when I use this:
do shell script "cd /workingdirectory; flic.command"

it returns and error of type 138.
whats the difference between these scripts thats causing the error? As far as I can tell they are identical except that one should run in terminal and one shouldn't.
     
Paul McCann
Mac Enthusiast
Join Date: Nov 2001
Location: Adelaide, South Australia
Status: Offline
Reply With Quote
Sep 1, 2003, 07:15 PM
 
Dunno if this is causing your difficulty, but one difference is the PATH (and other environment variables) in the two cases. In "do shell script" you get a totally stupid PATH set for you (including your HOME directory of all things), while in your terminal version the PATH is rather more standard.

Insert an "echo $PATH" into the two commands and have a look at the result in each. Could be that your flic.command is making some assumption about the PATH that is failing somehow. Try using absolute paths inside flic.command and see if that helps.

Cheers,
Paul
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:36 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,