I want to use the magic of subshells and redirection with the python subprocess module, but it doesn't seem to work, complaining about unexpected tokens are the parenthesis. For example, the command
cat <(head tmp)
when passed to subprocess gives this
>>> subprocess.Popen("cat <(head tmp)", shell=True)
<subprocess.Popen object at 0x2b9bfef30350>
>>> /bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `cat <(head tmp)'
/bin/sh
. I think that syntax may only with inbash
. Do you want subprocess to runbash
? Is that the question? – Leesman sh
, the man page that came up was bash. Scott Lamb pointed out that when invoked assh
, this feature is unavailable, so in a sense, yes, I wanted it run asbash
, even though I thought it already was. – Renettarenew