Hello everyone!
I want to use bash from python, however the os.system(command) seems to act only on one command at a time.
I want to use complete commands, also containing control flow statements, like If and While, and to call them from python.
something like this code in bash:
T1="foo"
T2="bar"
if [ "$T1" == "$T2" ]; then
echo even
else
echo not even
fi
I tried to use os.system and separate the commands with ';' , and it works only on simple one line commands, but not on control flow commands.
I also want to get the command output back to my python program somehow. the os.system function returns the exit status of the command but not its output.
any suggestions?
thanks!