local tmp=`mktemp`
trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT
-$PERL -npe 's/^/# /' < $comment > $tmp
+{ $PERL -npe 's/^/# /' <$comment ; print } >$tmp
zmodload -F zsh/stat b:zstat
zstat -A ctimePrev +ctime $tmp
$EDITOR $tmp
zstat -A ctime +ctime $tmp
[[ $ctime != $ctimePrev ]] || {
- echo Aborting comment >&2
+ print Aborting comment >&2
exit 0
}
if [[ -s $comment ]]; then
- $PERL -ne 'print if $can; if (/^$/) { $can=1 };' < $tmp > $comment
+ $PERL -ne 'print if $can; if (/^$/) { $can=1 };' <$tmp >$comment
else
- cat < $tmp > $comment
+ cat <$tmp >$comment
fi
git add $comment