I want to be able to detect if my script is being run interactively from the command line or non interactively say via system call, cron, etc.
I want it redirect stdout,stderr to a file if non interactive.
Does anyone know how to detect this programmatically?
thank you.
In reply to Detecting interactive/non-interactive shell by kosun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |