bug-bash
[Top][All Lists]
Advanced

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

"read < <(:); echo $?" prints 0 when job control is disabled (should be


From: Alastair Hughes
Subject: "read < <(:); echo $?" prints 0 when job control is disabled (should be 1?)
Date: Sun, 10 Jan 2016 14:16:12 +1300

When job control is enabled:
  $ read < <(:); echo $?
  1
When job control is disabled:
  $ read < <(:); echo $?
  0

Is this a bug, or valid behavior? It seems to be caused by 
already_making_children being set in the bash without job control; the shell 
waits for a child and sets exec_status to 0 (the read builtin returns 1). I've 
reproduced this on both an x86_64 machine and in a MIPS VM, with both bash 
4.3.42, and bash 4.4.0 (ie devel).

Note that (with job control disabled)
  $ : | read; echo $?
  1
and
  $ false < <(:); echo $?
  0
or,
  $ false <(:); echo $?
  0
while
  $ false; echo $?
  1
(using a process substitution seems to trigger the behavior)

Alastair Hughes



reply via email to

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