#!/bin/sh trap 'echo "notes: Input so far is saved to \"$tmpfile\"" >&2; exit 1' 2 3 15 tmpfile=$(mktemp ~/.notes.XXXXXX) || exit 1 cat >$tmpfile rm -f $tmpfile .