I have a file that looks like this:
-config1 -config2 param2 -config3 param3a param3b -config4 param4
and I can use the following to extract
echo $(<file) | cut -d' ' -f3
However I would like to fix it such that I always get the word after
-config2, such that if these get re-arranged or something is
inserted, my command will still work. What should I be looking at?
Clarification: there may be more than one params on any given line (or none at all), however there will always be at most one
-config option per line.