cat <(echo yes)
Displays "yes". And running this inside sh -m
results in the same thing on Bash 5.2.15.
Yet on Bash 4.4.20 it throws an error:
sh -c "cat <(echo yes)"
sh: -c: line 0: syntax error near unexpected token `('
Why the error?
Are there any other ways sh -c
differs from running sh
and then typing the command?
sh
bash in both cases? If the list of differences is given in https://www.gnu.org/software/bash/manual/bash.html#Bash-POSIX-Mode (which may vary from version to version, check the installed documentation to see for each version). If it's some other shell that's sh, there will be other differences. – muru Jul 07 '23 at 05:16echo yes
,echo yes | cat
andecho yes | cat /dev/stdin
also outputyes
, can you give a more relevant example of why you'd need to use ksh-style process substitution. – Stéphane Chazelas Jul 07 '23 at 05:50sh
is a link todash
in my linucies (is that the plural of linux?) - what is it in yours? – Jaromanda X Jul 07 '23 at 05:57sh
is generally a POSIX-compliant shell, so you shouldn't expect it to understand the extra features of other shells. It seems you have the world backward, thinking ofsh
as an exception rather than as the base. – Toby Speight Jul 07 '23 at 06:16