• 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
How to return error message text from do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to return error message text from do shell script


  • Subject: How to return error message text from do shell script
  • From: Steve Herman <email@hidden>
  • Date: Wed, 7 Jul 2004 10:23:59 -0500

I'm calling a bash shell script (which I wrote) with "do shell script" within a try block. If the shell script does an "exit" with a non-zero value then I enter the "on error" portion of the try block. The error number returned to AppleScript is the number I exited with and the error message text is something like "An error of type <my exit number> has occurred."

Is there a way to set the error message _text_ within the shell script (prior to my "exit" statement) such that the message that gets returned to AppleScript is more meaningful?

I tried redirecting an echo statement to stderr but that didn't seem to work. It seems like I figured out how to do this at some point in the past, but I couldn't locate that old code. Is there possibly a shell variable that contains error message text that I can set?

Steve

--

Steve Herman
Macintosh Software Development and Support
Lockheed Martin Information Technology
102 Research Blvd, Building 2
Madison, AL 35758 (voice) 256 319-2869
mailto:email@hidden (fax) 256 319-2984
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: How to return error message text from do shell script
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: (OFF) Curiosity & It's Relation To Cats...
  • Next by Date: Re: Sorting a list of Lists
  • Previous by thread: [OT] Re: SNAFU
  • Next by thread: Re: How to return error message text from do shell script
  • Index(es):
    • Date
    • Thread