Pipe STDIN to a script that is itself being piped to the Python interpreter? Pipe STDIN to a script that is itself being piped to the Python interpreter? bash bash

Pipe STDIN to a script that is itself being piped to the Python interpreter?


I figured out how to do this without creating any temporary files, but not strictly with "pipes".

curl http://example.com/huge_file.txt | python <(svn cat file://$REPO/trunk/my_script.py) --argument1 --argument2

I used the "anonymous file descriptor" construct in Bash, which can be used in place of any file path.

E.g.python my_script.pywould be equivalent topython <(cat my_script.py)


I don't think this is possible. You feed the script as standard input to the python interpreter. This means that the python interpreter is already attached to an input stream. I don't think the script contents can create a second standard input to read from.