/dev/nullOnly integers will be compared he" />
Change if [ "$tt" ~ '/^[1-9][0-9]*$/' ] to
if [ "$tt" -le 0 -o "$tt" -ge 0 ] 2>/dev/null
Only integers will be compared here. If $tt is not an integer, an error message will be generated and no comparison will be made. Then execute the action after else. The error message generated can be discarded using 2>/dev/null.
If it is an integer, compare within []. The -o in the middle means or, which means that if the integer $tt is less than or equal to 0 or greater than or equal to 0, it is true, and the action after then is executed