A Unix irritation: pipeline statusLet's start with a Bourne shell irritation. Suppose you have a command sequence that looks like:
Further suppose that you want to know whether It's tempting to blame the Bourne shell for this, but I think that its hands are at least partially forced by our old friend SIGPIPE. Consider this pipeline:
What's the exit status of this pipeline, assuming that Sed will exit successfully after writing ten lines. But this closes the
pipe, which means that (The shell could consider pipeline commands that exited on Hence, the only reliable exit status is the exit status of the last command in the pipeline; everything else can wind up 'failing' when they have not in fact failed, it's just that the pipeline has shut down early. (One comment.)
|
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |