Showing results for 
Search instead for 
Do you mean 

grep command

SOLVED
Go to Solution
Honored Contributor [Founder]

Re: grep command

I think this is not possible with grep/egrep/fgrep. May be gnu grep will help.

Without gnu grep, you can do it as follows.

grep "156.152.45.5" ./file|awk -F " " '{if(length($1)==12)print}'

Anil
There is no substitute to HARDWORK
Honored Contributor [Founder]

Re: grep command

similar to Mr. Soler's

awk -v var=$ADRESSIP '
$1 == var {print $2;}' yourFile
Highlighted
Honored Contributor [Founder]

Re: grep command

Hai,

We can use ^ and $ to notify the begin and end of string. It is easy to get the exact string.

ADRESSIP=156.152.45.5
grep ^${ADRESSIP}$

Regards,
Muthukumar
Easy to suggest when don't know about the problem!