tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "Hutcheson, Mike" <Mike_Hutcheson@baylor.edu>
Subject: Summary: Getting client IP address from shell
Date: Fri, 31 Jan 2003 13:50:34 -0600	[thread overview]
Message-ID: <D803FD4F4425EB4588FE27C71F5EE3E96AA63A@FS-EXCHANGE1.baylor.edu> (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


                 reply	other threads:[~2003-01-31 19:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

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