• 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 with unix sub command and CocoaDialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do Shell script with unix sub command and CocoaDialog


  • Subject: Re: Do Shell script with unix sub command and CocoaDialog
  • From: Doug McNutt <email@hidden>
  • Date: Fri, 7 Mar 2008 09:46:26 -0700

At 19:49 -0500 3/6/08, Mark J. Reed wrote:
>I wanted to point out that you
>can also go the other way (sort of) and have "do shell script" run a
>different shell, e.g.
>
>do shell script "bash -c " & quoted form of "shell command that you
>want to send to bash instead of sh"

Another option is to prepare the script you want to run as a file. It can be created in /tmp with AppleScript writes or it can be saved in a known place.

Have the file start with a shebang line pointing to the shell, or other executable, you want to use.

#!/bin/tcsh
#shell commands

Set the execute permission bit for the file.

Then just do "Do Shell Script" "full path to the file". You'll get an instance of sh which will do nothing but pass control to the executable.

An advantage is that your regular shell startup files, in this case $HOME/.tcshrc, will get executed even though the spawned shell is not a login shell. Your $PATH variable will be as expected.

It's possibly a bit slow but you'll never notice it.
--

--> From the U S of A, the only socialist country that refuses to admit it. <--
 _______________________________________________
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

References: 
 >Do Shell script with unix sub command and CocoaDialog (From: Tim Piper <email@hidden>)
 >Re: Do Shell script with unix sub command and CocoaDialog (From: Christopher Nebel <email@hidden>)
 >Re: Do Shell script with unix sub command and CocoaDialog (From: Luther Fuller <email@hidden>)
 >Re: Do Shell script with unix sub command and CocoaDialog (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Plist Problem (LNS Property List Tools)
  • Next by Date: Re: Do Shell script with unix sub command and CocoaDialog
  • Previous by thread: Re: Do Shell script with unix sub command and CocoaDialog
  • Next by thread: Re: Do Shell script with unix sub command and CocoaDialog
  • Index(es):
    • Date
    • Thread