about summary refs log tree commit diff stats
path: root/pages/unixtips.md
blob: 4b142509d26c15b945fe634a65f065b48158c8bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!--
title: UNIX ProTips
description: Handy tips for budding power users
author: xvetrd
-->

# UNIX ProTips

I realized today I wasn't getting mail notifications, and I hadn't set
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 
(or other shell RC file) in your home directory.

```
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.

```
PS1="\$([-s /var/mail/`whoami` ] && echo '* ')$PS1"
```

For maildir try this:

```
PS1="$(test -z "`ls -A $HOME/Maildir/new`" || echo '* ')$PS1"
```

This works in `/bin/ksh`, I can't speak for other shells.

If anybody else has some quick tips they would like to share, I encourage
them to edit this page.

Happy Unixing!

[back](/)