From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21496 invoked from network); 8 Aug 2003 17:35:17 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 8 Aug 2003 17:35:17 -0000 Received: (qmail 8867 invoked by alias); 8 Aug 2003 17:35:04 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6459 Received: (qmail 8855 invoked from network); 8 Aug 2003 17:35:03 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 8 Aug 2003 17:35:03 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.64.233.107] by sunsite.dk (MessageWall 1.0.8) with SMTP; 8 Aug 2003 17:35:2 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h78HZ1Q20833 for zsh-users@sunsite.dk; Fri, 8 Aug 2003 10:35:01 -0700 From: Bart Schaefer Message-Id: <1030808173501.ZM20832@candle.brasslantern.com> Date: Fri, 8 Aug 2003 17:35:01 +0000 In-Reply-To: <20030804194344.GA30657@spiegl.de> Comments: In reply to Andy Spiegl "how to find out who I am" (Aug 4, 9:43pm) References: <20030804194344.GA30657@spiegl.de> <20030804231842.GA15136@spiegl.de> In-Reply-To: <20030804231842.GA15136@spiegl.de> Comments: In reply to Andy Spiegl "Re: how to find out who I am" (Aug 5, 1:18am) X-Mailer: Z-Mail (5.0.0 30July97) To: ZSH User List Subject: Re: how to find out who I am MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 4, 9:43pm, Andy Spiegl wrote: } } I'd like to find a way to let zsh distinguish between us, but } the environment variable SSH_CLIENT doesn't help because both of us } log in from workstations with constantly changing IPs. On Aug 5, 1:18am, Andy Spiegl wrote: } } > ssh root@somehost -t REALME=andy exec zsh } Great. } Does that have any disadvantages (i.e. any differences) from } compared with the "normal" ssh root@somehost ??? You might prefer ssh root@somehost -t REALME=andy exec zsh -l to run zsh as a login shell. Another trick that I've used in the past is to modify the TERM variable, which is automatically passed across rsh, rlogin and ssh connections, and then set it back again in the shell startup files. For example, on the local machine alias ssh='TERM=$LOGNAME/$TERM ssh' and in .zshrc (or even .zshenv) on the remote machine if [[ $TERM = */* ]]; then RPS1=$TERM:h # For example TERM=$TERM:t fi This has the advantage of being completely transparent to non-interactive shells (which don't care about $TERM), and it is propagated automatically in the event you need to do something like ssh -t user@firstremote ssh other@secondremote (which I have sometimes had to do in order to ssh through firewalls).