bash: getting line number of a specific word in a text file

Jun 10, 2004
31
0
0
Hello!

I'd like to know how can I get the line number of a specific word (found using a regular expression) in a text file using a bash script?


Thanks everyone :) Frank
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
AFAIK bash doesn't support regexps natively so you'll have to use something like grep or perl.
 
Jun 10, 2004
31
0
0
Awesome, that's exactly what I was searching. Thanks BingBongWongFooey.

Nothinman, sorry for the confusion, I used "bash" in the title to keep the windows folks away heh..


Frank