Hi,
I have file like below,
Srinivas Jala Srinivas Jala AA
Srikanth ML Srikanth ML KK
Vijay Kumar Dha Vijay Kumar Dha JJ
i want to compare like "Srinivas Jala" word in same line, if i found i shoud get some like found, or not found. Pls help to get the code.
You want to find a repeating string in a single line
pattern='whatever I want to find goes here'
awk -v patt="$pattern" ' {i=index($0, patt )
if(i && index(substr($0, i+1), patt ) )> 0
{print "found: ", $0}
} ' inputfilename
Jairaj
3
sed 's/Srinivas Jala/Found/1' file
Thanks to all your posts!!