Execution problems with grep command in scripting

Hi All,
I was looking for grep command option which can exactly matches the word in a file, for examples you may be seeing one word that is also in another word, there might be lkk0lv23 and a lkk0lv234 in which case lkk0lv23 will put BOTH hosts from the grep in.

I was using this in a bash script to grep multiple entries in a file and this causing me a duplicate copies in final output file, how to eliminate it, is their a similar command that I can use.

 grep -i "$line" "$CFILE"; sleep 1 >> "$OFILE"

grep -w "lkk0lv23" file

1 Like

It worked, Thanks