Prevent an open terminal from being closed
It has been a long time, so I am rusty with my commands.
I use a script to have reminders. One I have running will display "Meteor shower occurs after midnight." after 3 hours.
Is there a way to prevent me from accidentally closing a terminal which has my timer script running?
Update:
Here is my script.
#!/bin/bash
#
# Sound alarm after specifying time and message
# Must input time delay AND message in double quotes !!
#
#
# ** sleep can also accept intergers ex. sleep 7.63
# Made alias for it type al
# Print a trace of simple commands, for commands, case commands, select commands,
# and arithmetic for commands and their # arguments or associated word lists after they are expanded
# and before they are executed. The value of the PS4 variable is # expanded and the resultant value is printed before the # command and its expanded arguments.
Red='e[0;31m'
BRed='e[1;31m'
BIRed='e[1;91m' # ${BIRed} this works
Gre='e[0;32m'
BGre='e[1;32m'
BBlu='e[1;34m' # ${BBlu}
BWhi='e[1;37m'
Black='e[0;30'
BWhite='e[0m 1;37'
# This defines a variable containing the ANSI escape sequence to clear
# the effect of all previous ANSI escape sequences that define formatting (colors, underlining, etc).
RCol='e[0m';
soundfile="/usr/share/sounds/My_Sounds/Alarm_Clock_Sound.mp3"
clear
amixer -D pulse sset Master 40% > /dev/null 2>&1
if [ -f "$soundfile" ];
then
echo -e "${BGre}Soundfile is present."
else
echo "File $soundfile does NOT exist."
echo
echo "Program will now exit."
exit
fi
[ -z "$2" ] && {
echo
echo -e " ${BIRed}Error!! No time value given and/or message specified !!"
echo
echo -e " ${BBlu}Alarm Program 2018 ${RCol}"
echo
echo -e " alarm.sh [time value in seconds] Message in double Quotes";
echo -e " alarm 5m = 5 minute alarm"
echo -e " alarm 5h = 5 hour alarm"
echo -e " alarm 5d = 5 day alarm"
echo -e " alarm 1.5m = 1 minute 30 seconds alarm"
echo
echo -e " alarm.sh 1m ""Take bread out of oven."""
echo
exit 1; }
echo -e "