Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #198938

Re: Bash true/false builtings undocumented? "false" not working?

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: Bash true/false builtings undocumented? "false" not working?
Date 2018-08-17 16:20 +0200
Message-ID <wnNLB-1bk-21@gated-at.bofh.it> (permalink)
References <wnJoB-6ND-3@gated-at.bofh.it> <wnICd-6jg-3@gated-at.bofh.it> <wnM37-7a-13@gated-at.bofh.it> <wnNix-Mt-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 17, 2018 at 03:43:58PM +0200, tomas@tuxteam.de wrote:
> The construction
> 
>   foo && echo "bar" || echo "baz"
> 
> does probably work, because echo's exit status is (always?) 0 (the bash
> builtin's documentation mumbles something about "write error").

echo can fail if stdout is closed, or if it's redirected to a file that
can't be written to (because of a full disk, etc.).

Sure, it may work 99.99% of the time, but it's still not safe.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bash true/false builtings undocumented? "false" not working? Zenaan Harkness <zenaan@freedbms.net> - 2018-08-17 10:50 +0200
  Re: Bash true/false builtings undocumented? "false" not working? Zenaan Harkness <zenaan@freedbms.net> - 2018-08-17 11:00 +0200
  Re: Bash true/false builtings undocumented? "false" not working? Nicolas George <george@nsup.org> - 2018-08-17 11:00 +0200
    Re: Bash true/false builtings undocumented? "false" not working? Zenaan Harkness <zenaan@freedbms.net> - 2018-08-17 11:30 +0200
    Re: Bash true/false builtings undocumented? "false" not working? Zenaan Harkness <zenaan@freedbms.net> - 2018-08-17 11:40 +0200
      Re: Bash true/false builtings undocumented? "false" not working? Nicolas George <george@nsup.org> - 2018-08-17 11:40 +0200
      Re: Bash true/false builtings undocumented? "false" not working? <tomas@tuxteam.de> - 2018-08-17 12:20 +0200
      Re: Re: Bash true/false builtings undocumented? "false" not working? Clive Standbridge <list-user@tgstandbridges.plus.com> - 2018-08-17 14:10 +0200
        Re: Re: Bash true/false builtings undocumented? "false" not working? <tomas@tuxteam.de> - 2018-08-17 15:40 +0200
      Re: Bash true/false builtings undocumented? "false" not working? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-17 14:30 +0200
        Re: Bash true/false builtings undocumented? "false" not working? <tomas@tuxteam.de> - 2018-08-17 15:50 +0200
          Re: Bash true/false builtings undocumented? "false" not working? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-17 16:20 +0200
            Re: Bash true/false builtings undocumented? "false" not working? <tomas@tuxteam.de> - 2018-08-17 16:40 +0200
              Re: Bash true/false builtings undocumented? "false" not working? Zenaan Harkness <zenaan@freedbms.net> - 2018-08-18 01:10 +0200
        Re: Bash true/false builtings undocumented? "false" not working? Zenaan Harkness <zenaan@freedbms.net> - 2018-08-18 01:30 +0200
  Re: Bash true/false builtings undocumented? "false" not working? <tomas@tuxteam.de> - 2018-08-17 11:30 +0200
    Re: Bash true/false builtings undocumented? "false" not working? Zenaan Harkness <zenaan@freedbms.net> - 2018-08-17 11:40 +0200
      Re: Bash true/false builtings undocumented? "false" not working? <tomas@tuxteam.de> - 2018-08-17 11:50 +0200
        Re: Bash true/false builtings undocumented? "false" not working? tomas@tuxteam.de - 2018-08-17 12:00 +0200
      Re: Bash true/false builtings undocumented? "false" not working? Stefan Krusche <linux@stefan-krusche.de> - 2018-08-23 15:00 +0200
        Re: Bash true/false builtings undocumented? "false" not working? <tomas@tuxteam.de> - 2018-08-23 16:30 +0200

csiph-web