I am trying to match a pattern and set that as a variable.
I have a file with many "value=key". I want to find the value for key "fizz". In the file I have this string
fizz="something_cool"
I try to parse it as:
cat file | grep fizz="(.*)"
I was thinking it would give me the group output, and then I would be able to use $1
to select it.
I also play with escaping characters and sed
and awk
. But I could not manage to get it working.