Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Slightly OT: Error-Handling in a Pipeline, preferably non-zsh
- X-seq: zsh-users 7866
- From: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- To: Aaron Davies <agdavi01@xxxxxxxxxxxxxx>
- Subject: Re: Slightly OT: Error-Handling in a Pipeline, preferably non-zsh
- Date: Mon, 16 Aug 2004 11:08:45 -0500
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <95305BF6-EF81-11D8-83BE-000502631FBD@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Pine.LNX.4.61.0408160048470.21654@xxxxxxxxxxxxxxxxxx> <95305BF6-EF81-11D8-83BE-000502631FBD@xxxxxxxxxxxxxx>
In the last episode (Aug 16), Aaron Davies said:
> On Monday, August 16, 2004, at 03:51 AM, Bart Schaefer wrote:
> >On Sun, 15 Aug 2004, Aaron Davies wrote:
> >>On Sunday, August 15, 2004, at 11:03 PM, Philippe Troin wrote:
> >>
> >>>Use your first idiom and check $pipestatus[4].
> >>
> >>Thanks, that seems to solve it (though it's [3], not [4]).
> >
> >If you have the KSH_ARRAYS option set, it's best to say so when
> >asking for help on this list, or you're going to see a lot of this
> >kind of "mistake."
>
> I'm running this under Bourne sh, as I mentioned in my original
> request. (Well, technically, I think on this box it's bash, running
> in sh emulation mode.) I assume this is the default array indexing
> mode for sh?
Bourne shell doesn't have arrays or $pipestatus, so if you really want
/bin/sh compatibility, you can't use either. You'll probably have to
split your pipe at the place you want to check the resultcode, and use
a temp variable to store your intermediate output.
--
Dan Nelson
dnelson@xxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author