• 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 flaw
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script flaw


  • Subject: Re: do shell script flaw
  • From: Axel Luttgens <email@hidden>
  • Date: Sun, 6 Dec 2009 18:31:15 +0100

Le 6 déc. 2009 à 02:41, Emmanuel LEVY a écrit :

> Hi Axel, thanks for tactfully giving me an occasion to make myself clearer.

And thanks for having done it. :-)


> My script runs on idle. It does:
>
> 1. do shell script "top"
> 2. do shell script "ifconfig"
> 3. do shell script "mkdir"
>
> Usually it works all right. Sometimes, what I observe is:
>
> 1. works
> 2. fails, I don't know the error message because the script traps the error (I suppose that it's the same as in 3.)
> 3. fails with "The command exited with a non-zero status", which means a shell scripting error - not a particular command's error
>
> This suggests that 1. has broken do shell script until the script terminates (next "idle" will be a fresh new instance).
>
> For those not familiar, there is indeed no way to trigger "The command exited with a non-zero status" with do shell script "mkdir" let alone do shell script "ifconfig".
>
> Steps 2. and 3. run in many other occasions, and as far as I know they don't break do shell script.
>
> I suppose my problem is to use an interactive command, but I don't really know what this implies. I'm changing for "ps" instead of "top".

Putting the various pieces together, I'm currently trying this one in Script Editor:

	set Cnt to 0
	repeat
		do shell script "top -l 1"
		do shell script "ipconfig getifaddr en0"
		do shell script "mkdir -p ~/Desktop/aaaa/" & Cnt & "/aaa"
		set Cnt to Cnt + 1
	end repeat

without being able to reproduce the phenomenon (I also tried "-l 2", as well as without the invocation of ipconfig).

Of course, this is not in the context of an idling stay open application.
And this is under 10.6.2.
Could you anyway try that script? Unless you've already tested something similar?

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: 
 >Re: Do shell script vs terminal discrepancy (From: airdrummer <email@hidden>)
 >Re: Do shell script vs terminal discrepancy (From: Paul Skinner <email@hidden>)
 >Re: Do shell script vs terminal discrepancy (From: Simon Topliss <email@hidden>)
 >Re: Do shell script vs terminal discrepancy (From: Paul Skinner <email@hidden>)
 >do shell script flaw (From: Emmanuel LEVY <email@hidden>)
 >Re: do shell script flaw (From: Emmanuel LEVY <email@hidden>)
 >Re: do shell script flaw (From: Axel Luttgens <email@hidden>)
 >Re: do shell script flaw (From: Emmanuel LEVY <email@hidden>)

  • Prev by Date: Re: do shell script flaw
  • Next by Date: Re: do shell script flaw
  • Previous by thread: Re: do shell script flaw
  • Next by thread: Re: iCal Recurring events
  • Index(es):
    • Date
    • Thread