diff --git a/ssam b/ssam index c7fb999..5094340 100755 --- a/ssam +++ b/ssam @@ -43,9 +43,9 @@ if [ -z "$TMPDIR" ]; then fi tmp="$TMPDIR/ssam.tmp.$USER.$$" -cat "$@" >$tmp +trap 'result=$?; rm -f "$tmp"; exit $result' INT EXIT KILL +cat "$@" >"$tmp" -input() { # select entire file echo ',{' @@ -57,8 +57,6 @@ input() [ ! -z "$flagf" ] && cat "$flagf" [ ! -z "$flage" ] && echo "$flage" [ "$flagn" -eq 0 ] && echo ',' -} - -input | sam -d "$tmp" 2>/dev/null +} | sam -d "$tmp" 2>/dev/null -rm -f "$tmp" \ No newline at end of file +exit $? \ No newline at end of file