Reputation: 2650
I have a string:
abc = "2342"
or: any string = "any number"
I wanna have a return value of 2342 (or any number)
How can I do it (using SED would be the best)
Upvotes: 0
Views: 93
Reputation: 6141
sed 's/^[^=]*= *"\([^"]*\)"$/\1/'
or
sed -E 's/^[^=]*= *"([^"]*)"$/\1/'
Assumptions:
Upvotes: 2