I need to find the position of a certain word in a text file I tried to do something like this but it didn't work (no any output): For example txt file contains:
A B C
Tarun A12 1
Man B6 2
Praveen M42 3
So I need to find a word ,,Tarun" position the output should be: Row: 2 Column 1 But instead I get no output
read -p "Write a word: " word
awk '{
for(i=1;i<=NF;i++)
if($i == '$word')
print "Row: " NR, "Column: " i
}' file.txt