Re: Another shell script query
Re: Another shell script query
- Subject: Re: Another shell script query
- From: Charles Arthur <email@hidden>
- Date: Thu, 6 Jun 2002 11:16:14 +0100
On Wed, 5 Jun 2002 20:54:25 -0700, Christopher Nebel <email@hidden> wrote:
(after garbanzito <email@hidden> and Simon Kornblith
<email@hidden> had helpfully weighed in):
>
Alternatively, you can suppress the error in the shell script itself
>
like this:
>
>
do shell script "curl --help || echo -n"
>
>
The "||" means "if the previous command on the left fails, do the
>
command on the right." echo -n prints nothing and succeeds, so you get
>
all the output and it claims success. (There are probably other ways to
>
do this; this is just the first one that came to mind.)
Obviously I'd be interested in the "other ways", just out of idle
curiosity. Simon's idea of error-trapping did seem the safest (in that it
would catch dire fallovers) but "||" is very intriguing.
I was just idly trying to create a GUI wrapper for the "--help" function
with AStudio, since I find the Terminal a bit unwieldy in text-editing
terms. It would have been a 5-minute coding job, but perhaps it'll be 24
hours instead. Ah me. And it may need an entire 5 lines of code including
the start and end of the handler. OSX is hell.
Any more sneaky Unix tricks like "||" welcome here, anyway.
Charles
----------------------------
http://www.ukclimbing.com : 1100+ British crags, 350+ British climbing
walls - searchable by distance and anything else you care to think of -
with weather forecasts for every one, plus maps, articles, news and
features. And there's even a cool shop attached.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________
_______________________________________________
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.