Suppose I have the following variable
$string = 'cat somecommandhere'
Now the output of the above cat command is
test="Thanks serverfault"
I want to extract the value between the quotes and store it in the same variable $string, including the quotes. I want string to contain value below:
$string = "Thanks serverfault"
How can this be done with sed or grep but not awk. I haven't learned awk yet.
cutis a specialized tool with few options to learn, as opposed toawkandsedwhich have their own associated sub-languages. – Andrew B Mar 2 at 19:26sedorgrepyou guys should just say so. And then present a case forawk. – Stefan Lasiewski Mar 4 at 5:47