I've written a bash script which captures video with DVgrab. Because of the nature of the tapes that I am digitizing, sometimes I want to quit capturing before the time that I set for DVgrab. When this is the case I press Ctrl-c and DVgrab exits cleanly, my problem is that there is additional information that the script prints in the terminal with 'echo' when the script runs till it's set time. When I Ctrl-c none of this information prints...
Is there a way to intercept the SIGINT ( I think this is what I want, but I could be wrong) and have it operate exactly as it does by default, but additionally echo a few varibles in the terminal?
Preferably I would like to do this just in my script... and not effect the way Ctrl-c functions system wide.
Not sure if it matters, but based on my reading prior to this post I wasn't sure, but I run this script in a virtual terminal in gnome on an Ubuntu (8.10) Linux machine
The bit that I wanted to add when Ctrl-c is pressed looks like this:
Code:
echo -e "\E[31;40m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+ Warning - Capture Ended Early +"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo -e "\E[30;47m++ Format: $FORMAT ++ Min Remaing on $destination : $minremain "
echo "++ Deck: $deck_number ++ Customer: $customer "
echo "++ Rec Time: $tape_length ++ Tape: $tapename"
Thanks in advance!
-Starcast