I\'m trying to write a shell script that searches in a file specified as argument $1 for a regex and writes the found subpattern into a variable I can then use.
let\'s s
You could try something along the lines of
value=`grep '^set output' $x | cut -d' ' -f 3`
(Note that you will retain the quotes in $value
$value