Re: do shell script hanging
Re: do shell script hanging
- Subject: Re: do shell script hanging
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 10 Apr 2008 07:19:06 -0400
On Thu, Apr 10, 2008 at 4:49 AM, Bastiaan Boertien
<email@hidden> wrote:
> Put this in a shell script file:
>
>
> exec $* &> /dev/null &
> echo $!
> do shell script "path/to/thread.sh " & quoted form of
> "/Applications/Firefox2.app/Contents/MacOS/firefox -P toto"
The disconnection is incomplete, but more importantly, that approach
will fail for any pathnames which contain spaces, which tend to crop
up a lot on OS X.
Try this instead:
#!/bin/sh
prog="$1"
shift
exec "$prog" "$@" </dev/null >/dev/null 2>&1 &
echo $!
And then you can invoke it without any more quoting than what you need
any time you're doing do shell script. For instance, this will work:
do shell script "/path/to/thread.sh
/Applications/Firefox2.app/Contents/MacOS/firefox -P toto"
--
Mark J. Reed <email@hidden>
_______________________________________________
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