On Mon, 27 Dec 2004 15:08:34 -0700, Christopher J Bidwell <[EMAIL PROTECTED]> wrote: > Is there a way that I can grep out a specific IP range out of an NBE file?
yes > > grep '192\.168\.0\.[3-25]' old.nbe > new.nbe the last bit is a bad regular expression, remember it matches charaters not what you want it to match. The [3-25] bit says match anything from '3' up to '2' or '5'. here is a simple way to get what you want: grep '192\.168\.0\.[3-9][^0-9]' old.nbe >new.nbe grep '192\.168\.0\.1[0-9][^0-9]' old.nbe >>new.nbe grep '192\.168\.0\.2[0-5][^0-9]' old.nbe >>new.nbe Now there are more compact ways of doing it but this should be clearer man grep for the details good luck, marc > > I thought this would have worked but it doesn't give me the results I'm > looking for. > > In this example I want to be able to grep out (and let me know if there is > a better command for doing this that I'm not yet aware of): > > 192.168.0.[3-25] only. I was getting 192.168.0.50 in this result...Doesn't > quite make sense. Any ideas? > > Thanks, > Chris > > _______________________________________________ > Nessus mailing list > [email protected] > http://mail.nessus.org/mailman/listinfo/nessus > _______________________________________________ Nessus mailing list [email protected] http://mail.nessus.org/mailman/listinfo/nessus
