zsh-users
 help / color / mirror / code / Atom feed
From: Timothy J Luoma <luomat+Lists/Zsh/users@luomat.peak.org>
To: zsh-users@math.gatech.edu
Subject: Is there a way to find the Remote Host in ZSH?
Date: Mon, 29 Jun 98 16:26:56 -0400	[thread overview]
Message-ID: <199806292026.QAA10696@ocalhost> (raw)


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



             reply	other threads:[~1998-06-29 20:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-29 20:26 Timothy J Luoma [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199806292026.QAA10696@ocalhost \
    --to=luomat+lists/zsh/users@luomat.peak.org \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).