Timeline for Check if script is started by cron, rather than invoked manually
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 20 at 10:36 | comment | added | Chris Davies | Not really. There'd be nothing preventing me from running the script from my interactive session with TERM=dumb /path/to/script | |
| May 17, 2023 at 18:50 | comment | added | Adam Katz | In cron, $TERM is either empty or set to "dumb" depending on your distribution. See my answer for further detail, including a way to use $TERM that works for either of those two values that also adds $- for further safety. | |
| Apr 14, 2023 at 16:50 | comment | added | RonJohn | THIS is the answer. A shell script in my environment with echo $TERM run from a $ prompt says "linux", but says "dumb" when run from cron. | |
| Dec 15, 2017 at 17:08 | history | edited | Stephen Rauch | CC BY-SA 3.0 | Format code |
| Dec 15, 2017 at 17:03 | review | Late answers | |||
| Dec 15, 2017 at 17:08 | |||||
| Dec 15, 2017 at 16:58 | review | First posts | |||
| Dec 15, 2017 at 17:34 | |||||
| Dec 15, 2017 at 16:45 | history | answered | vegivamp | CC BY-SA 3.0 |