From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21222 invoked from network); 29 Jun 1998 20:34:11 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 29 Jun 1998 20:34:11 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id QAA09913; Mon, 29 Jun 1998 16:29:09 -0400 (EDT) Resent-Date: Mon, 29 Jun 1998 16:25:29 -0400 (EDT) Message-Id: <199806292026.QAA10696@ocalhost> Content-Type: text/plain MIME-Version: 1.0 From: Timothy J Luoma Date: Mon, 29 Jun 98 16:26:56 -0400 To: zsh-users@math.gatech.edu Subject: Is there a way to find the Remote Host in ZSH? Resent-Message-ID: <"gNV_k.0.0P2.vW_br"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1656 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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