In bash script I am taking command line input in alphanumeric values. example: D7, 12D I want to assign these value to some variable but I want only numeric values to be assigned. In above example value should be assigned as 7 and 12
In linux it can be done by
echo "D7" |grep -o '[0-9]*'
I want this should work for both linux,unix servers. Above command doesnt work on solaris box.
Thanks for help
~Ankit
14D7, in which case should that be treated as14,7, or147?