I've asked a similiar question to this, but this time it is different, a little more restrictive....I have a variable, $varib, that should always only contain numeric characters. I need a way to echo something if the variable contains a letter, space, or some other punctuation character, ,.!>?" etc.
Previously I used: grep '[a-zA-Z]' and that can work for letters, but what about the other characters?
#!/usr/bin/bash #my checkbk #input
echo "input number"
read varib #if $varib contains a letter, space, comma, period, or other character #echo something #exit 1 #else #echo good number, thanks.