I have a bash script that runs something along the lines of:
python myscript.py --input=/path/file --someOption=value > /path/file
If I ran it without the redirect, everything works fine. If I run it with the redirect, the file gets truncated. I suspect python is executing the whole line including the redirect when in fact the redirect has to be executed by bash.
I tried:
exec "python myscript.py --input=/path/file --someOption=value" but I get command not found error.
How do I get python to execute just the python portion, and the redirect to be executed by bash?
execattempt to do exactly.