I have to search string in in file searchstring is Ev_SQL_DIR=/dev/mirror/sched/sql and to be searched in file having content as per below
cat file.txt
Ev_SQL_DIR=/dev/mirror/sched/sql
Ev_TRIG_DIR=/hubdev/mirror/sched/trig
Ev_DB2_ENC_STR={iisenc}lasdbDxMsMFVOJBK0Gsg==
EV_COMPILEOPT=-c -O -fPIC -Wno-deprecated -m64 -mtune=generic -mcmodel=small
I used sed -n '/$searchstring/p' file.txt
but it gives below error and I tried to escape also tried to use regex but not able to get it right. any inputs?
sed: -e expression #1, char 24: unknown command: `S'