I want to valid a specific word whether it is contained in the text file. For example:
family.txt
father
mother
son
sister
if ("father" contain in family.txt)
do some process
else
do other process
How shell scripting can accomplish this? Anyone can provide helps?
Hi dude,
With Regards
Anish Kumar.v
Aia
3
if [[ -n `grep -m 1 'father' family.txt` ]]; then
# do some process
else
# do some other process
fi
This is what i got
grep: illegal option -- m
Usage: grep -hblcnsviw pattern file . . .
May i know where did i do wrong?