I have string contains a path
string=\"toto.titi.12.tata.2.abc.def\"
I want to extract only the numbers from this string.
To extrac
This would be easier to answer if you provided exactly the output you're looking to get. If you mean you want to get just the digits out of the string, and remove everything else, you can do this:
d@AirBox:~$ string="toto.titi.12.tata.2.abc.def"
d@AirBox:~$ echo "${string//[a-z,.]/}"
122
If you clarify a bit I may be able to help more.