Process substitution not allowed by Python’s subprocess with shell=True?
/bin/sh: 1: Syntax error: “(” unexpected You have a bashism. It is not valid according to POSIX, which is what /bin/sh implements.
/bin/sh: 1: Syntax error: “(” unexpected You have a bashism. It is not valid according to POSIX, which is what /bin/sh implements.
This is a known limitation in bash 3.2. To work around it: source /dev/stdin <<<“$(echo bar=bar)” …or, similarly: source /dev/stdin <<<“$(cat <(…))”
You should run your script with bash, i.e. either bash ./script.sh or making use of the shebang by ./script.sh after setting it to executable. Only running it with sh ./script.sh do I get your error, as commented by Cyrus. See also: role of shebang at unix.SE
The syntax you’ve used is a bash extension to the basic shell syntax, so you must take care to run your script with bash. (Ksh also has >(…) process substitution but doesn’t support it after a redirection. Zsh would be fine.) Given the error message you’re getting, you are running this script in bash, but … Read more
Duplicate &1 in your shell (in my examle to 5) and use &5 in the subshell (so that you will write to stdout (&1) of the parent shell): exec 5>&1 FF=$(echo aaa|tee >(cat – >&5)) echo $FF Will print aaa two times, ones because of the echo in the subshell, and second time print the … Read more