You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mblaze/setmap

13 lines
261 B
Bash

#!/bin/sh -e
# setmap [-a] - store/append stdin as santoku map (can be used as filter)
: ${MAILMAP:=~/.santoku/map}
if [ "$1" = -a ]; then
cat ${MAILMAP} - >"${MAILMAP}-"
else
cat >"${MAILMAP}-"
fi
mv "${MAILMAP}-" "${MAILMAP}"
[ -t 1 ] || cat "${MAILMAP}"