You should be using "grep" instead of "sed" for this purpose. Anyway, this works for me:
$ cat emp.lst
john reed
peter sullivan
pete blake
rob turner
$ cat em.sh
#!/usr/bin/bash
echo -e "Enter string to be searched :\c"
read str
sed -n "/$str/p" emp.lst
$ em.sh
Enter string to be searched :pete
peter sullivan
pete blake
rikxik thanks!
yeah i should be using grep but my main intention was not to search the emp.lst my main intention of asking this question was how to use variable in sed