britishguy
Newbie
UID 77
Digest Posts
0
Credits 0
Posts 71
Reading Access 10
Registered Apr 25, 2007
Status Offline
|
|
|
help with grep
help with grep
hi.
i'm trying to grep a line that starts with a specific number from a file using a loop. the problem is:
grep -w $i filename (e.g. for i=1)
gives me back
line 1
line 10
line 11
...
and so forth. i only want 1 (and not 11, 12, 13. and so forth).
i need a loop that goes up to a large value, so i don't want to restrict the number of characters i'm searching for. i just want to match whole words and not letters within words. i thought the -w flag did that, but it's not. i also tried grep \<1\> to search for just "1" but i get no results back.
thanks for your help!.
|
|
|