diff options
author | gbmor <ben@gbmor.org> | 2023-09-05 14:50:18 +0000 |
---|---|---|
committer | gbmor <ben@gbmor.org> | 2023-09-05 14:50:18 +0000 |
commit | 6532e13f7a6fd20b42dd64c275780c6e23d7c9f1 (patch) | |
tree | b5f1752242502ea84db53bda7d3c72bd7fb8c44b /pages/unixtips.md | |
parent | 6081430382305a378d6d35dffaaf9e1187feeb0f (diff) | |
parent | 4e2c82f4fb8119d3dfde9fb82b7685beda6c8cc2 (diff) | |
download | wiki-6532e13f7a6fd20b42dd64c275780c6e23d7c9f1.tar.gz |
Merge pull request 'Improve command substitution' (#7) from rjc/wiki:command_substitution into trunk
Reviewed-on: https://tildegit.org/institute/wiki/pulls/7
Diffstat (limited to 'pages/unixtips.md')
-rw-r--r-- | pages/unixtips.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pages/unixtips.md b/pages/unixtips.md index 4b14250..84b74ad 100644 --- a/pages/unixtips.md +++ b/pages/unixtips.md @@ -11,7 +11,7 @@ them up on this shell. So here are some things I do on my local machine that work here: To get the shell to tell you when you have new mail, after command -executions, add this to your `.profile` or your `.kshrc` files +executions, add this to your `.profile` or your `$ENV` files (or other shell RC file) in your home directory. ``` @@ -20,16 +20,16 @@ export MAILCHECK=0 And, if you want, you can have a persistent notification when you have un-incorporated mail, or more specifically, when your -`/var/mail/<username>` isn't empty. +`$MAIL` (`/var/mail/$USER` by default)` isn't empty. ``` -PS1="\$([-s /var/mail/`whoami` ] && echo '* ')$PS1" +PS1="$(test -s $MAIL ] && echo '* ')$PS1" ``` For maildir try this: ``` -PS1="$(test -z "`ls -A $HOME/Maildir/new`" || echo '* ')$PS1" +PS1="$(test -n "$(ls -A $HOME/Maildir/new)" && echo '* ')$PS1" ``` This works in `/bin/ksh`, I can't speak for other shells. |