regular expression not working. grep[^0-9]
echo 8989898989898 |grep [^0-9] > /dev/null 2>&1
if [ "$?" -eq "0" ] then echo "inside if " nrec=1 fi output shows.. + echo 8989898989898 + grep 3 + 1> /dev/null 2>& 1 + [ 1 -eq 0 ] Not sure how grep [^0-9] is converted to 3 . Any help. |
You need to put the expression in quotes. It is being interpreted by the shell.
|
you can check it by:
echo [^0-9] |
All times are GMT -5. The time now is 05:26 AM. |