• 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 undesired behaviour (!)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script undesired behaviour (!)


  • Subject: Re: do shell script undesired behaviour (!)
  • From: Emmanuel LEVY <email@hidden>
  • Date: Mon, 15 Nov 2010 13:18:31 +0100

Another thing which may cause an unpredictable amount of frustration is when you forget "quoted form" before calling rm.

Also, I would have thought that "rm" without "administrator privileges" would leave /System untouched? Maybe also iTunes, in order that you still be able to make purchases... :-)

Emmanuel

On Nov 15, 2010, at 11:09 AM, Shane Stanley wrote:

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 (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to 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
  • Follow-Ups:
    • Re: do shell script undesired behaviour (!)
      • From: Shane Stanley <email@hidden>
References: 
 >Re: do shell script undesired behaviour (!) (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Changing voice in VoiceOver
  • Next by Date: Re: do shell script undesired behaviour (!)
  • Previous by thread: Re: do shell script undesired behaviour (!)
  • Next by thread: Re: do shell script undesired behaviour (!)
  • Index(es):
    • Date
    • Thread