I have this variable:
A="Some variable has value abc.123"
I need to extract this value i.e abc.123. Is this possible i
abc.123
As pointed out by Zedfoxus here. A very clean method that works on all Unix-based systems. Besides, you don't need to know the exact position of the substring.
A="Some variable has value abc.123" echo $A | rev | cut -d ' ' -f 1 | rev # abc.123