bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pipefail bug


From: Chet Ramey
Subject: Re: pipefail bug
Date: Mon, 04 Dec 2006 11:53:03 -0500
User-agent: Thunderbird 1.5.0.8 (Macintosh/20061025)

John Kelly wrote:
> #!/bin/bash
> 
> # With -e -o pipefail, this script should exit immediately upon returning
> # from the pipeline, since grep does not match its string, and returns 1.

This is not true, strictly speaking.  The `-e' option applies to only
simple commands.  Bash does make `-e' apply to pipelines whose last
element is a simple command, but only for compatibility with historical
shell implementations.  That accounts for the apparent anomaly.

Posix is not exactly clear on this topic, but I believe bash's
interpretation is conformant.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]