On Wednesday March 25 2009, David C. Rankin wrote:
Listmates,
I set up a simple trap to gzip any open files on scripts interrupt or exit:
cleanup () { echo -e "\n\tExecuting cleanup from trap\n" [[ -e $NEWFILE ]] && gzip --force --quiet $NEWFILE [[ -e $XMLFILE ]] && gzip --force --quiet $XMLFILE
}
trap cleanup SIGINT SIGTERM EXIT
rest of script....
trap works correctly, but when it is called, it seems to be inserting 45 blank-lines after the original command line causing the terminal to scroll-up. Looks odd:
It's certainly not trap or you echo command that's doing that. I'd look to the behavior of whatever command is being interrupted. Also, you might want to capture the output and see if it's really just 45 newlines or possibly something else.
...
-- David C. Rankin
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org