do shell script undesired behaviour (!)
do shell script undesired behaviour (!)
- Subject: do shell script undesired behaviour (!)
- From: julifos <email@hidden>
- Date: Mon, 15 Nov 2010 10:39:22 +0100
- Thread-topic: do shell script undesired behaviour (!)
Hi all!
It's a long time since I don't read anymore applescript release notes nor
I'm up-to-date with latest changes in the language.
But I'm so surprised with this (for me) new behaviour that I thought I
should share it, just in case someone isn't aware or just in case it's a bug
in my system (10.6.4, intel).
See this code:
----------------
do shell script "cd /BAD/PATH; ls -la"
----------------
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 think it's the same in a Terminal window, so maybe AS can't do nothing at
this point (?)
I also noticed that now the default path in do shell script is the root:
----------------
do shell script "pwd"
--> "/"
----------------
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.
Thanks God I detected the issue and lost only some GBs of re-installable
applications ;-)
jj
_______________________________________________
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