That will also match 999.9.99.9 which isn't an ip address.
On Sep 21, 6:46 am, Neeraj 17.neera...@gmail.com wrote:
*grep -R \[0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+\ * | awk -F':' '{print $1}' |
uniq
*
works on my system :P
On Tue, Sep 21, 2010 at 2:07 PM, Chi c...@linuxdna.com
With perl installed:
find directory | xargs perl -pi -e 's/needle/replace/g'
With sed installed:
#!/bin/bash
find directory mirror
exec 3mirror
while read file 3
do
replace=`more $file | sed -r -e 's/needle/replace/g'`
cat $replace $file
done
On Sep 19, 11:30 pm, bittu
grep /home/user/dir -d recurse -H \b(?:(?:25[0-5]|2[0-4][0-9]|[01]?
[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
the ugly looking block matches IP address. GREP is a gnu regex utility
in linux (also available for windows).
/home/user/dir is the location of the directory
-d
*grep -R \[0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+\ * | awk -F':' '{print $1}' |
uniq
*
works on my system :P
On Tue, Sep 21, 2010 at 2:07 PM, Chi c...@linuxdna.com wrote:
With perl installed:
find directory | xargs perl -pi -e 's/needle/replace/g'
With sed installed:
#!/bin/bash
find
What does [0-9]\+. means? Why do you nested it?
On Sep 21, 3:46 pm, Neeraj 17.neera...@gmail.com wrote:
*grep -R \[0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+\ * | awk -F':' '{print $1}' |
uniq
*
works on my system :P
On Tue, Sep 21, 2010 at 2:07 PM, Chi c...@linuxdna.com wrote:
With perl installed:
@Neeraj:
Your approach is good, this however lists .999.999.999 which is
not a valid IP address.
grep -lR [0-255]\.[0-255]\.[0-255]\.[0-255] *
further filter out the output of above to invalidate any ip address
that are reserved.
-l is for suppressing normal output and printing only
Sorry this doesn't work all grep out there ...
On 22 Sep, 01:40, Prem Mallappa prem.malla...@gmail.com wrote:
@Neeraj:
Your approach is good, this however lists .999.999.999 which is
not a valid IP address.
grep -lR [0-255]\.[0-255]\.[0-255]\.[0-255] *
further filter out the output of