echo "ginger bread.k +log ../output1 -format +m=3 0 +sleep 10 +suspend 10" | ...
Substitua ...
por:
grep :
grep -oP '\+m=\K\d+'
sed :
sed -E 's/.*\+m=([0-9]+).*//'
awk :
awk -F'+m=| ' '{print $7}'
perl :
perl -lne 'print $& if /\+m=\K\d+/'
bash :
x="ginger bread.k +log ../output1 -format +m=3 0 +sleep 10 +suspend 10"
[[ $x =~ \+m=([0-9]+) ]] && echo ${BASH_REMATCH[1]}
Saída
3