tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Summary: Getting client IP address from shell
@ 2003-01-31 19:50 Hutcheson, Mike
  0 siblings, 0 replies; only message in thread
From: Hutcheson, Mike @ 2003-01-31 19:50 UTC (permalink / raw)


Fantastic!  I received several very helpful responses to my question about getting the client IP address from the shell during a telnet or ssh session.  The list of respondents is long so to keep things short I'll just say thanks to everyone who replied.

The simplest solution that I received from several people was to use the who -m command and pipe it through awk and sed.

#!/bin/sh
client_addr=`who -m | awk '{ printf $NF }' |  sed 's/[()]//g'`

Thanks again!

Mike Hutcheson (Mike_Hutcheson@baylor.edu)
Systems Manager (254) 710-4110
Baylor University - Information Technology Services


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-01-31 19:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-31 19:50 Summary: Getting client IP address from shell Hutcheson, Mike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox