Re: do shell script undesired behaviour (!)
Re: do shell script undesired behaviour (!)
- Subject: Re: do shell script undesired behaviour (!)
- From: Shane Stanley <email@hidden>
- Date: Mon, 15 Nov 2010 21:09:04 +1100
- Thread-topic: do shell script undesired behaviour (!)
On 15/11/10 8:39 PM, "julifos" <email@hidden> wrote:
> Previously, if you concatd various commands in the same do shell script, the
> first of them causing errors would cause also an applescript error, so
> subsequent commands wouldn't be executed (in this sample, "ls -la").
I can't remember, but it surprises me to think that it has changed.
> I also noticed that now the default path in do shell script is the root:
>
> ----------------
> do shell script "pwd"
> --> "/"
> ----------------
I don't think that's changed, either (actually, I believe it inherits the
path of the process calling it).
>
> Now, let's combine both new behaviours and see what happened in my comp two
> days ago, when I was running some tests:
>
> ----------------
> do shell script "cd /bogus/path; rm -rf"
> ----------------
>
> Result: delete everything in the boot disk.
Again, I'm not sure that's new. I have a very, very good friend, ahem, who
got bitten by that very thing a couple of years ago. Very embarrassing :-(
Another thing that's not new but can result in unexplained behavior: if you
hit the escape key at the time your app is calling do shell script, the
process will terminate immediately.
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
_______________________________________________
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