I could not find where to post this programming question, so apologies if I am in the wrong place. But if you can help, please do. Thanks.
Here goes:
/root/InterfacesList has the following lines
ESSID:"gynaecentre"
ESSID:"EDENVALE"
ESSID:"VALLEY HEALTH CARE SERVICES"
ESSID:"LENOX GAYLE"
ESSID:"ARRIS-7D72"
ESSID:"Nexxt_5B3BF8"
ESSID:"LIVING WATERS"
ESSID:"HP-Print-8C-ENVY 4500 series"
A script has:
Code: Select all
TheEssid="LIVING WATERS"
if (grep "LIVING WATERS" /root/Interfaceslist -c -q);then
echo $TheEssid found
else
echo $TheEssid Not found
fi
I wish to use the variable TheEssid instead of hard-coding LIVING WATERS in the grep line.
How do I do this? Neither replacing LIVING WATERS with TheEssid nor with $TheEssid works nor does $(grep .....