• 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
Getting pid and error from do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting pid and error from do shell script


  • Subject: Getting pid and error from do shell script
  • From: Luther Fuller <email@hidden>
  • Date: Sat, 23 Dec 2006 15:47:05 -0600

I have a script with something like this ...

	do shell script the result & " &> /dev/null & echo $!"
	set pid to the result

I have another script with something like this ...

	"hdiutil convert " & inFile & " -format UDZO -encryption -o " & outFile
	try
		do shell script the result
	on error
		return -- here if user cancels encryption
	end try

In the second script, I need the error because the user may click the Cancel button in the encryption dialog.

My problem is that I also need to get a pid from the second script if the user does NOT click Cancel. I have read TN2065 "do shell script in AppleScript" for the third time, but it offers no understanding of this problem. (It recommends that I "See the sh man page under "Redirection" for more details." ... but there is no man page for sh!)

Does anyone know an answer?

_______________________________________________
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/mailman//archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Getting pid and error from do shell script
      • From: David Simerly <email@hidden>
  • Prev by Date: Re: AppleScript Studio Problems...
  • Next by Date: Re: AppleMods missing?
  • Previous by thread: [OT] Holiday time
  • Next by thread: Re: Getting pid and error from do shell script
  • Index(es):
    • Date
    • Thread