• 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: Axel Luttgens <email@hidden>
  • Date: Mon, 15 Nov 2010 13:39:09 +0100

Le 15 nov. 2010 à 10:39, julifos a écrit :

> Hi all!
>
> [...]
>
> 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 (?)

Are you sure you aren't confusing with:

	do shell script "cd /BAD/PATH && ls -la"

where one explicitly requires the first command to be successful for having the second one to be executed?


> I also noticed that now the default path in do shell script is the root:
>
> ----------------
> do shell script "pwd"
> --> "/"
> ----------------

I think this has always been the case with "do shell script"; that said, this isn't official behavior, and it is always a good idea not to rely on such behaviors.

To get a rather exhaustive idea of the environment provided by your current version of AppleScript to "do shell script", you could have a look at the output of such commands:

	do shell script "set"
	do shell script "echo $-" -- see the 'set' builtin fro more info
	do shell script "shopt"


HTH,
Axel

 _______________________________________________
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 undesired behaviour (!) (From: julifos <email@hidden>)

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