linux:bash
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:bash [2023-09-25 20:42] – [HowTo] dave | linux:bash [2023-09-25 20:44] (current) – [Bash] dave | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Bash ====== | ====== Bash ====== | ||
| - | FIXME: This isn't really bash, it's random Linux stuff that I'm tired of looking | + | Bash stuff that I'm tired of looking |
| Line 25: | Line 25: | ||
| ===== Detect if Script is Run by Cron ===== | ===== Detect if Script is Run by Cron ===== | ||
| # Check if script is cron or shell - two versions. | # Check if script is cron or shell - two versions. | ||
| + | * [[https:// | ||
| < | < | ||
| - | https:// | ||
| if [ -t 1 ] ; then | if [ -t 1 ] ; then | ||
| echo " | echo " | ||
| Line 32: | Line 32: | ||
| #send mail | #send mail | ||
| fi | fi | ||
| + | </ | ||
| - | ----------------------- | + | < |
| CRON=$(pstree -s $$ | grep -q cron && echo true || echo false) | CRON=$(pstree -s $$ | grep -q cron && echo true || echo false) | ||
| then test with | then test with | ||
linux/bash.1695674524.txt.gz · Last modified: by dave
