so for example, I have a string like this:
f=awerawet1351&q=aet12462awera&l=3ewar462&h=awiejt361
and I wanna grab the substring between "q=" and "&", which is "aet12462awera" or "q=aet12462awera" is also fine.
I tried to useawk -F'&'
, but the thing is, the position for "q="string is not fixed. Sometimes, I will have
f= .... & l=.... &q=....& h=....
so I can't use awk -F'&' '{print $2}'
to get the result.
Is there anyway for me to use unix command to get it? Thanks!