Re: [opensuse] BASH - Why does trap output 45 blank lines to the terminal?
Aaron Kulkis wrote:
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:
08:33 alchemy:~/linux/scripts/parse> sh xmlparse test.xml.gz
Executing cleanup from trap This may be a feature, but if I can turn it off, that would be great. What say the bash gurus?
insert this line in your script:
set -x
It will tell you all kinds of wonderful things.
I'll give it ago. Thanks Aaron! -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (1)
-
David C. Rankin