mblaze/msetseq
2016-07-20 14:08:37 +02:00

13 lines
262 B
Bash
Executable File

#!/bin/sh -e
# msetseq [-a] - store/append stdin as santoku seq (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}"