[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
syntax errors produced by interaction between process substitution and a
syntax errors produced by interaction between process substitution and a SIGCHLD trap
Wed, 31 Jul 2019 13:35:52 -0500
Configuration Information [Automatically generated, do not change]:
Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security
uname output: Darwin 6841b968 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr
25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin17.7.0
Bash Version: 5.0
Patch Level: 7
Release Status: release
I stumbled into an odd interaction between process substitution and
a SIGCHLD trap that causes syntax errors in otherwise valid commands.
I managed to pare this down to a very minimal reproduction. I also
included a more realistic command at the end just in case I'm mistaken
about the minimal reproduction showing exactly the same issue.
I see the same behavior in bash 4.4.23(1)-release and do *not* see
it in the macos system bash 3.2.57(1)-release.
$ bash5 --norc --noprofile
bash-5.0$ trap '$()' SIGCHLD
bash-5.0$ $(:) $(:)
bash: command substitution: line 3: syntax error near unexpected
bash: command substitution: line 3: `:)'
# Note that backticks don't cause the same trouble
bash-5.0$ `:` `:`
# in case there are multiple issues here
# I found it while composing a command like this (to expand a set
of globs, one per line, saved in file "exclude")
bash-5.0$ /usr/bin/env cat <(printf "%s\n" $(< exclude ));
bash: command substitution: line 6: syntax error near unexpected
bash: command substitution: line 6: `< exclude ));'
|[Prev in Thread]
||[Next in Thread]|
- syntax errors produced by interaction between process substitution and a SIGCHLD trap,
Travis Everett <=