I've a bash script invoking a python script I want to feed the content of
file via stdin. Calling the bash script like:
./script.sh < file
And the contents of
#! /usr/bin/env bash pushd /some/python/virtual/environment/working/dir source venv/bin/activate python main.py ?????? deactivate popd
I've no idea what to fill in for
?????? to pass the contents of
file given to the bash script as stdin to the python script
file can be a substantial text file and using bash's
read is not desirable.
Using stdin when invoking the bash script is a requirement. I'm flexible to pass whatever to
Any ideas out there how to tackle this conundrum?
The answer by @cas made it clear to me that I also need to explain in which context I try to use
I want to use
script.sh as a forwarding script in
~/.forward, with the contents:
Which postfix does call as
/path/to/script.sh; the log is clear about that. A simple test using a dressed down version of the python script, like:
Demonstrates that postfix does call
main.py with the content of the mail on the stdin. But the combination doesn't seem to work.