Re: [ILUG] grep or awk

From: Fergal Daly (fergal at domain esatclear.ie)
Date: Mon 10 Sep 2001 - 11:57:58 IST


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 domain linux.ie
> http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
> List maintainer: listmaster at domain linux.ie

-- 


This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:12:02 GMT