Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grep help

Status
Not open for further replies.

Neelimaix

Technical User
Jun 29, 2005
23
0
0
US
hi i have a file with

nil-=100
nil=1000
nil=10002
when i do

$grep 100 filena.txt its printing all the lones

how can i print only one it matches ?


Thanks,
A
 
grep '=100$' filena.txt

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
grep -w 100 may also do it, but not sure how grep defines a word. If a word is any character string delimited by whitespace, then it won't. Try it.

HTH,

p5wizard
 
Furthermore the -w option isn't (AFAIK) POSIX (nor X/OPEN) compliant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top