For the script to print "Is numeric" on screen, what would the user have to enter when prompted?
#!/bin/bash
read -p "Enter text " var
if [[ "$var" =~ "^[0-9]+$" ]];then
echo "Is numeric"
else
echo "Is not numeric"
fi
For the script to print "Is numeric" on screen, what would the user have to enter when prompted?
#!/bin/bash
read -p "Enter text " var
if [[ "$var" =~ "^[0-9]+$" ]];then
echo "Is numeric"
else
echo "Is not numeric"
fi