The following script results in error when called directly, but not when called with . ./test.sh:
% cat test.sh
echo "foo" |
tee >(rev)
% . ./process_subst_test.sh
foo
oof
% ./process_subst_test.sh
./process_subst_test.sh: line 1: syntax error near unexpected token `('
./process_subst_test.sh: line 1: `echo "foo" | tee >(rev)'
% echo "foo" |
tee >(rev)
foo
oof
What is wrong about the process redirection syntax in the script?
Why results vary depending on how script is invoked?
My shell is:
% zsh --version
zsh 5.8.1 (x86_64-apple-darwin21.0)