From: Dan Nelson <dnelson@allantgroup.com>
To: Aaron Davies <agdavi01@louisville.edu>
Cc: zsh-users@sunsite.dk
Subject: Re: Slightly OT: Error-Handling in a Pipeline, preferably non-zsh
Date: Mon, 16 Aug 2004 11:08:45 -0500 [thread overview]
Message-ID: <20040816160844.GJ73391@dan.emsphone.com> (raw)
In-Reply-To: <95305BF6-EF81-11D8-83BE-000502631FBD@louisville.edu>
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@allantgroup.com
prev parent reply other threads:[~2004-08-16 16:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-16 1:04 Aaron Davies
2004-08-16 2:42 ` Bart Schaefer
2004-08-16 3:33 ` Aaron Davies
2004-08-16 7:41 ` Bart Schaefer
2004-08-16 12:40 ` Aaron Davies
2004-08-16 14:53 ` DervishD
2004-08-17 3:06 ` Bart Schaefer
2004-08-16 3:03 ` Philippe Troin
2004-08-16 3:30 ` Aaron Davies
2004-08-16 7:51 ` Bart Schaefer
2004-08-16 12:41 ` Aaron Davies
2004-08-16 16:08 ` Dan Nelson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040816160844.GJ73391@dan.emsphone.com \
--to=dnelson@allantgroup.com \
--cc=agdavi01@louisville.edu \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).