Re: user ip

From: Barry Margolin (barry.margolin_at_level3.com)
Date: 04/29/03


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.


Relevant Pages

  • Re: "Shanghai Stock Exchange" and OpenVMS
    ... include an equivalent to the Unix apropos command as a serious ... a Unix system that actually _had_ apropos. ... it's Solaris something, probably 8. ...
    (comp.os.vms)
  • SUMMARY: Debugging process in Unix
    ... can also be used with a pid ... It all depends on how deep you wish to go and what version of Solaris ... > What is the command to see what a process is doing in Unix? ...
    (SunManagers)
  • Re: "Shanghai Stock Exchange" and OpenVMS
    ... The VMS User's manual is. ... So Unix was a progress. ... command via different paths. ... I also use Solaris 8, Solaris 9, Solaris 10, and ...
    (comp.os.vms)
  • Re: anyone have software to OCR a PDF?
    ... for me to remember the command name... ... I just knocked up a script on UNIX (Solaris 10) to give a frequency ...
    (comp.sys.apple2)
  • Re: user ip
    ... >> Depending on what version of unix you're running you can probably get ... >> it from the who command. ... > whatever% whoami ...
    (comp.unix.shell)