I want to access printed value from python in bash script
for example of python code
# test.py
def main():
print('True')
if __name__ == '__main__':
s = input()
if s == "True":
main()
And, there are example(ex.sh) bash script
#!/bin/bash
echo {EX} | python test.py
Command:
bash ex.sh True
I hope to load variable from python in bash. It is fault but one of the ideas is like:
OUTPUT=$(echo {EX} | python test.py 2>&1)
I should appreciate if you advice me