Hi
I am trying to create a script that greps a file for a character then returns the line number of that character. This is fine but when you use grep -n it returns the line number and the whole line of text. Is there away of getting it to just come back with the line number ?
example
Code:
cat filename | grep -n "="
this returns
Code:
16:=============================================================================
=======================================================
19:=============================================================================
=======================================================
22:=============================================================================
=======================================================
25:=============================================================================
=======================================================
28:=============================================================================
=======================================================
31:=============================================================================
=======================================================
35:=============================================================================
=======================================================
38:=============================================================================
=======================================================
41:=============================================================================
=======================================================
44:=============================================================================
=======================================================
when all i need is the line number