I was trying to extract strings of the following form:
[["abc"]] --> abc
So I wrote echo "[[\"abc\"]]" | sed -e 's/\[\[\"//g' | sed -e 's/\"\]\]//g'
And it works fine but looks extremely ugly. I'm pretty much sure that there should be a neater solution for such a simple case?
Can you please advice some sed
or awk
enhancement for that?
If you are just looking for what is between the double-quotes, try this
echo '[["abc"]]' | awk -F\" '{print $2}'
Hope this helps