Re: user ip
From: Barry Margolin (barry.margolin_at_level3.com)
Date: 04/29/03
- Next message: Rich: "Re: user ip"
- Previous message: sinapsi: "Re: user ip"
- In reply to: sinapsi: "Re: user ip"
- Next in thread: Rich: "Re: user ip"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 29 Apr 2003 15:20:02 GMT
In article <Vwwra.31298$K35.988658@news2.tin.it>, sinapsi <info@zam.it> wrote:
>
><joe@invalid.address> ha scritto nel messaggio
>news:m3of2pcq4m.fsf@invalid.address...
>> "sinapsi" <info@zam.it> writes:
>>
>> > I have a script that run on user login. I would like to show to the
>> > user his ip. where do I get it?
>>
>> Depending on what version of unix you're running you can probably get
>> it from the who command. On Solaris, for example you could do
>> something like
>>
>> $ who | grep omcldbpr (or whatever the username is)
>> omcldbpr pts/11 Apr 28 16:38 (jollymd-1)
>> $ who | grep omcldbpr | awk '{print $6}'
>> (jollymd-1)
>>
>
>Yes , but this is a problem if there is a user that is connected for more
>that one times and with different ips.
Instead of grepping for the username, grep for the tty device name.
-- Barry Margolin, barry.margolin@level3.com Genuity Managed Services, a Level(3) Company, Woburn, MA *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups. Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
- Next message: Rich: "Re: user ip"
- Previous message: sinapsi: "Re: user ip"
- In reply to: sinapsi: "Re: user ip"
- Next in thread: Rich: "Re: user ip"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|