dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

mailboxes (570B)


      1 #!/bin/sh
      2 
      3 mailroot="$HOME/.mail"
      4 sfeedroot="$HOME/.cache/sfeed"
      5 
      6 die() {
      7 	printf '%s\n' "$1" >&2
      8 	exit 1
      9 }
     10 
     11 if [ ! -d "$mailroot" ]; then
     12 	die "mailroot ($mailroot) does not exist"
     13 fi
     14 
     15 echo "mailboxes \\"
     16 
     17 if [ -f "/var/mail/$USER" ]; then
     18 	printf ' "%s" \\\n' "/var/mail/$USER"
     19 fi
     20 if [ -f "$HOME/mbox" ]; then
     21 	printf ' "%s" \\\n' "$HOME/mbox"
     22 fi
     23 if [ -d "$sfeedroot" ]; then
     24 	for f in "${sfeedroot}/"*; do
     25 		printf ' "%s" \\\n' "$f"
     26 	done
     27 fi
     28 
     29 cd $mailroot
     30 find . -type d | grep -v -e '^\.$' -e '\/cur$' -e '\/new$' -e '\/tmp$' | \
     31 	sed 's/^\.\// "+/;s/$/" \\/'
     32 
     33 echo