Awk

display the lines of files gven as parameter which
contain a same word found in consecutive positions.For that line
display the lines and line number within
file it belongs

Help us to help you : please give more clue : how does the format of your input file look like ?
any field separator ?
Please post an example of input and expected output.

1 Like

don't you have an old one from which you can built another 'alike' one ?

1 Like

what do you mean with "consecutive positions" : separated by a space ? by a tab ? other ?

---------- Post updated at 12:41 PM ---------- Previous update was at 12:30 PM ----------

# cat tst
bla bla
toto toto bla bla
bla bla toto tutu toto
toto    toto
bla bla toto toto
bla bla
bla bla
bla toto toto bla
bla bla
toto      toto bla bla
bla bla
bla bla
# v=toto
# grep "$v[[:blank:]]*$v" tst
toto toto bla bla
toto    toto
bla bla toto toto
bla toto toto bla
toto      toto bla bla
# egrep -e "$v[[:blank:]]*$v" tst
toto toto bla bla
toto    toto
bla bla toto toto
bla toto toto bla
toto      toto bla bla
#