[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
syntax errors produced by interaction between process substitution and a
From: |
Travis Everett |
Subject: |
syntax errors produced by interaction between process substitution and a SIGCHLD trap |
Date: |
Wed, 31 Jul 2019 13:35:52 -0500 |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin17.7.0
Compiler: clang
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
Description:
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.
Repeat-By:
$ bash5 --norc --noprofile
bash-5.0$ trap '$()' SIGCHLD
bash-5.0$ $(:) $(:)
bash: command substitution: line 3: syntax error near unexpected
token `)'
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
token `)'
bash: command substitution: line 6: `< exclude ));'
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- syntax errors produced by interaction between process substitution and a SIGCHLD trap,
Travis Everett <=