Hi there,
This is giving me a bit of headache. Trying to grep out IP addresses from files, so looking for a "xxx.xxx.xxx.xxx" address format:-
cat /tmp/test |egrep "[0-9]{1,3}\.[0-9]{1,3}\.([0-9]{1,3}"
This is the command I came up with, sort 0-9, 1-3 times followed by a dot. It works but it also picks up numbers which are four characters in length:
1.111.11.1111
111.1111.111.111
111.111.1111.111
111.111.111.1111
1111.111.111.111
Can anyone spot my mistake, it is driving me round the bend and I have a mental block right now!!
Thank you
PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
This is giving me a bit of headache. Trying to grep out IP addresses from files, so looking for a "xxx.xxx.xxx.xxx" address format:-
cat /tmp/test |egrep "[0-9]{1,3}\.[0-9]{1,3}\.([0-9]{1,3}"
This is the command I came up with, sort 0-9, 1-3 times followed by a dot. It works but it also picks up numbers which are four characters in length:
1.111.11.1111
111.1111.111.111
111.111.1111.111
111.111.111.1111
1111.111.111.111
Can anyone spot my mistake, it is driving me round the bend and I have a mental block right now!!
Thank you
PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP