[Bash]declare -i error message
by gerard4143 from LinuxQuestions.org on (#6MTK4)
Code:#! /usr/bin/env bash
set -euo pipefail
declare -i num1=0
read -r -p 'Enter first number: ' num1
echo "You entered: ${num1}"How can I display a message(better than the default) when the user enters a non-integer value for num1?
set -euo pipefail
declare -i num1=0
read -r -p 'Enter first number: ' num1
echo "You entered: ${num1}"How can I display a message(better than the default) when the user enters a non-integer value for num1?