doa
#!/bin/sh
myexe
myexe
if sys.stdout.isatty():
print 'from a script'
else:
print 'not from a script'
OUTPUT (if i execute doa from terminal):
not from a script
OUTPUT (if i execute myexe from terminal):
not from a script
I want it to say 'from a script
' if executed from doa
Question: is it possible for myexe to know that it's being executed from a bash script?