Help in "grep" command

Hi,
I am trying to grep special chars in unix using grep command but it is not working. Please help

Program:
while read line
do
echo $line
grep "${line}" 2.txt
fi
done < ./1.txt

1.txt contains the descriptions like "cust\. Name", "S-Serial No\."
Still it is trying to search the descriptions line "cust. Name" and "S-Searial No.". Please Guide me.
Thanks in advance

Try...

grep -f 1.txt 2.txt

Hi,

Try this.

fgrep -f 1.txt 2.txt

/usr/xpg4/bin/grep -e"xyz" <filename.1> ...

Should work. :slight_smile: