Im trying to find a line that contains the word ell
in a text file, however when I use the grep command my result is Well I don?t knowthat?er 10, 2016.
I also converted the text file using the dos2unix name_of_file.txt
command but the issue still lingers. What am I doing wrong? Please let me know.
Here is my script:
#!/bin/sh
if [ ! -f $2 ]
then
echo The file does not exist
exit
else
grep $1 $2
fi
Here is my text file:
Hello today is September 10, 2016.
NYC.
What the hell is that?
London.
Well I don’t know.
The result that I am expecting is:
Hello today is September 10, 2016.
What the hell is that?
Well I don’t know.