If we want to catch the first word of a file we need do add -zw
to grep
if grep -qzw "^$1" filethen ... else ... fi
Without -z
we get the first word of a line. Without -w
we get partial words.
If we want to catch the first word of a file we need do add -zw
to grep
if grep -qzw "^$1" filethen ... else ... fi
Without -z
we get the first word of a line. Without -w
we get partial words.