![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sed Range Issue | Wrathe | Shell Programming and Scripting | 2 | 06-17-2008 03:54 PM |
| Copying specific files from remote m/c to specific folders | jhoomsharabi | Shell Programming and Scripting | 0 | 06-12-2008 07:31 AM |
| specifing range.... | zedex | UNIX for Advanced & Expert Users | 1 | 10-19-2007 09:07 AM |
| Look a string within a range! | azmathshaikh | Shell Programming and Scripting | 0 | 05-01-2005 03:54 AM |
| Unix SCO 5.0.6 Out of range | josramon | UNIX for Dummies Questions & Answers | 5 | 02-21-2003 02:06 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
Match a specific IP range
Hello all,
I would like a bit of help with a problem I am having. I have the following example file: $ cat test_hosts 10.10.2.3 host1 10.10.2.4 host2 10.10.2.130 host3 10.10.2.5 host4 10.10.2.230 host5 10.10.2.22 host6 I need to match all IP addresses in the 10.10.2.1-10.10.2.22 range. I have tried all kind of things but for the life of me, I can't get it to work. $ cat test_hosts | egrep "10\.10\.2\.[1,22]\s" This shows nothing. $ cat test_hosts | egrep "10\.10\.2\.[1,22]" 10.10.2.130 host3 10.10.2.230 host5 10.10.2.22 host6 Not exactly what I need. What am I doing wrong ? Thanks, Sylaan |
|
||||
|
Yeah, forgot to mention that I tried the [1-22] and it didn't work for me either. I am on a SunOS 5.10.
The sort command works, thanks for that. Unfortunately I will have to eventually parse very large syslog files and I imagine that's not so efficient and fast ![]() |
![]() |
| Bookmarks |
| Tags |
| regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|