• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: do shell script woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script woes


  • Subject: Re: do shell script woes
  • From: Graff <email@hidden>
  • Date: Wed, 24 Dec 2003 23:34:36 -0500

Looks like cabextract is a tool that extracts Microsoft cabinet (.cab) files:
<http://www.kyz.uklinux.net/cabextract.php3>


Dunno what is wrong here. I would say that maybe it is the shell because he has a space in there and it runs from the terminal fine. $PATH shouldn't affect it because he is calling the tool using its full path.

Try calling it all as one line just to eliminate the variable this_path as a possibility:
do shell script "/sw/bin/cabextract /Users/lrivers/Desktop/cabs/06369022.cab"

If that doesn't work try calling it with the shell set explicitly to tcsh or bash:
do shell script "/bin/tcsh -c '/sw/bin/cabextract /Users/lrivers/Desktop/cabs/06369022.cab''"
or
do shell script "/bin/bash -c '/sw/bin/cabextract /Users/lrivers/Desktop/cabs/06369022.cab''"

Also note that if you call do shell script within a tell block the shell environment will be determined by the application whose tell block you are in. To be ultra safe, call a shell script from a tell application "Finder" block.

See this web page for more information on do shell script, especially read the last section "Gory Details":
<http://developer.apple.com/technotes/tn2002/tn2065.html>

- Ken

On Dec 24, 2003, at 10:59 PM, Doug McNutt wrote:

At 21:21 -0600 12/24/03, Lorin Rivers wrote:
This simple shell command works swimmingly from the command line in Panther, yet does nothing when called from my AppleScript.
set this_path to "/Users/lrivers/Desktop/cabs/06369022.cab"
--try
do shell script "/sw/bin/cabextract " & this_path
Suggestions?

Delimiter - a space - between /sw/bin/cabextract and this_path ?
Execute bit set for cabextract ?
Shebang line in cabextract? AppleScript ALWAYS goes first to the bash shell.
$PATH problems for something cabextract is looking for. Your .login/.profile is NOT being executed.

What is cabextract anyway? Something you wrote? Yeah - my ignorance is probably showing but my OS neXt box is shut down for the night.
_______________________________________________
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.

References: 
 >do shell script woes (From: Lorin Rivers <email@hidden>)
 >Re: do shell script woes (From: Doug McNutt <email@hidden>)

  • Prev by Date: Re: do shell script woes
  • Next by Date: Re: Regarding Unknown elements in AS GUI
  • Previous by thread: Re: do shell script woes
  • Next by thread: Re: do shell script woes
  • Index(es):
    • Date
    • Thread