Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is there a way to find the Remote Host in ZSH?



On Mon, Jun 29, 1998 at 04:26:56PM -0400, Timothy J Luoma wrote:
> 
> 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.
[snip]
> Is there a way to do this already that I just don't know about?
	
	it looks like it; on my machine, at least, i have REMOTE_HOSTNAME
and REMOTE_IPADDRESS defined when i log in:

(astaroth)~: set | grep 'REMOTE'
REMOTE_HOSTNAME=simon
REMOTE_IPADDRESS=208.135.210.91

	those aren't being set in any of the system-wide scripts or in
any of my personal ones, so i'm assuming that they are set by the shell.
the sad thing is that until you asked this, i was using an even uglier
kludge than yours to pull my remote host from the lastlog.

	on a mildly related note, does anyone know if wtmpx (on solaris,
at least) stores the full name of the remote host, and last/finger simply
truncates it?  the manpage on wtmpx defines ut_host as char ut_host[257];
i don't know any c, but assume this means that it is a 257-byte character
field.

	-- sweth.

-- 
Sweth Chandramouli
IS Coordinator, The George Washington University
<sweth@xxxxxxx> / (202) 994 - 8521 (V) / (202) 994 - 0458 (F)
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html";>*</a>



Messages sorted by: Reverse Date, Date, Thread, Author