Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 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. Commented Apr 14, 2023 at 16:50
  • 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. Commented May 17, 2023 at 18:50
  • Not really. There'd be nothing preventing me from running the script from my interactive session with TERM=dumb /path/to/script Commented Jan 20 at 10:36