zsh-users
 help / color / mirror / code / Atom feed
* Is there a way to find the Remote Host in ZSH?
@ 1998-06-29 20:26 Timothy J Luoma
  1998-06-29 21:35 ` Sweth Chandramouli
  1998-06-29 21:41 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Timothy J Luoma @ 1998-06-29 20:26 UTC (permalink / raw)
  To: zsh-users


I am looking for a way to get the complete hostname or IP address where I  
have connected _from_ when making a telnet/ssh/etc connection.

Right now the only thing I can figure out is 'who am i' which doesn't always  
give enough information:

kira!luomat   ttypb    Jun 29 13:16 (cc344191-a.ewnds)

The hostname is the last field, but it isn't complete and I'd prefer not to  
have to do

	REMOTE_HOSTNAME=`who am i | awk '{print $NF}' | tr -d '(|)'`

which is what I am currently using.

Anyway, I have some settings I would like to make specific to when I connect  
from certain IPs, so this would be helpful....

if [ "$REMOTE_IP" = "123.123.12.3" ]; then
	source specialfile
fi	

Something like REMOTE_IP or REMOTE_HOSTNAME (I think tcsh has something like that).

Is there a way to do this already that I just don't know about?

TjL



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-06-29 23:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-29 20:26 Is there a way to find the Remote Host in ZSH? Timothy J Luoma
1998-06-29 21:35 ` Sweth Chandramouli
1998-06-29 22:31   ` Bart Schaefer
1998-06-29 22:58     ` Geoff Raye
1998-06-29 21:41 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).