I have following traps(s) in my code
Line 913 triggers one of the traps with parenthesizes around
(case-insensitive).
Checked by removing them.
Since it is a text I do not mind removing the offending () .
But why it triggers both traps ?
PS Where does the "bad" in trap message comes from ?
There is nothing bad with trap , it is "good" to report problems.
And I do not get the ERR line number - but that is another issue I'll tackle later..
TRAPS
# ----------------------------------------------
308 # Step #3: Trap CTRL+C, CTRL+Z and quit singles
309 # ----------------------------------------------
310 trap '' SIGINT SIGQUIT SIGTSTP
311
err_report() {
31 echo "Error on line $1"
32 }
33
34 trap 'err_report $LINENO' ERR
OFFENDING CODE
do_hostname() {
910 if [ "$INTERACTIVE" = True ]; then
911 whiptail --msgbox "\
912 Please note: RFCs mandate that a hostname's labels \
913 may contain only the ASCII letters 'a' through 'z' (case-insensitive),
914 the digits '0' through '9', and the hyphen.
915 Hostname labels cannot begin or end with a hyphen.
916 No other symbols, punctuation characters, or blank spaces are permitted.\
917 " 20 70 1
TRAP output
pi@pi:/usr/bin $ sudo raspi-config.debug_7.sh
trap: ERR: bad trap
trap: SIGINT: bad trap
/usr/bin/raspi-config.debug_7.sh: 913: /usr/bin/raspi-config.debug_7.sh: Syntax error: "(" unexpected (expecting "fi")