How to test for a range of digits?
Hi, I intend to test the equality of a variable to a range of digits or characters, something like this:
if [ "$line3" == [0-9] ] then echo "$line3" fi I am aware that I could do it one at a time by not using [0-9] but it will be a longer code. Any help will be appreciated. Thanks a lot. |
Hi,
Welcome to LQ! Quote:
Close :} Code:
if [[ "$line3" =~ [0-9] ]]; then Cheers, Tink |
Quote:
|
All times are GMT -5. The time now is 12:48 PM. |