Alex Harris wrote:
> humm, which version of grep are you using, every instance I've tried
> brings back the results I mentioned (only the first hit on a line has
> the filename)?
>
> version's I've used:
> rh 9: 2.5.1
> debian sarge: 2.5.1
> cygwin: 2.5
> -- Also, did you include the "o" after the H?
Ahh... Just created a text file and found out what's happening...
If you have multiple IP addys on the same line it will place the later
entries on separate lines.
What you could probably do is nest a couple loops:
for item in `ls`; do
for IP_ADDRS in `egrep -o
"[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" ${item}`; do
echo -n ${item}:
echo ${IP_ADDRS}
done
done
Script is attached.
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:15:29 EDT