I have a variable with, among others, a line that looks like this
iBMC=277
I'm trying to match that like this:
BMC="$(echo "$allnow" | grep iBMC=[0-9] | sed 's/iBMC=//g')"
This makes BMC empty. Here's what it looks like in bash -x:
++ grep 'iBMC=[0-9] '
++ sed s/iBMC=//g
+ BMC=
I also have to match more things, like in this line:
Name="$(echo "$allnow" | grep stringName= | sed 's/stringName=//g')"
But it also turns out empty. Here is $allnow:
QQ1=0999999
QQ2=00aaaaa
RR=yes
GG=no
stringName=skolan8
sTitle=
iBMC=277
L3-cache="8 MB"
Minne="16 GB"