My query is: I want my bash script to scan a text file for a specific word and store the line number in a variable. I tried using "grep" and "find", but no progress was made. Is this possible to do?
Asked
Active
Viewed 60 times
0
-
3Did you forget to insert your code which isn’t working – asio_guy Nov 18 '17 at 00:44
-
1https://stackoverflow.com/questions/10589929/find-the-line-number-where-a-specific-word-appears-with-grep I found this by googling "grep line number" – zzxyz Nov 18 '17 at 00:49
-
2Thanks a lot for the help. @zzxyz . Your answer is the best on stackoverflow. – Mr. Weirdo Nov 18 '17 at 01:02
-
@potato thanks for the lovely response. All thanks to your decent answer, my code is working. – Mr. Weirdo Nov 18 '17 at 01:03
-
Weirdo, glad your code is now working. In light of your statement that @zzxyz's link worked for you, I have marked this question as a duplicate. – John1024 Nov 18 '17 at 01:18