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/msetseq

13 lines
262 B
Bash

#!/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}"