[ILUG] grep or awk

Fergal Daly fergal at esatclear.ie
Mon Sep 10 11:57:58 IST 2001


sed 's/.*(\(.*\)).*/\1/'

will extract stuff from inside brackets but it'll leave lines with no
brackets untouched

On Mon, Sep 10, 2001 at 11:40:09AM +0100, Patton, Tony wrote:
> I am trying to get the ip address of a user that has logged in via
> telnet.
> I can get this information from the 'who -M' command, which gives me the
> following :
> 
> 	xxxxxxx     ttyqb       Sep 10 11:33
> (xxx.xxx.xxx.xxx)
> 
> what i want is to get the ip address from within the brackets.
> 
> any solutions?
> 
> using Compaq Tru64 btw.
> 
> -- 
> Irish Linux Users' Group: ilug at linux.ie
> http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
> List maintainer: listmaster at linux.ie

-- 




More information about the ILUG mailing list