zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: ZSH User List <zsh-users@sunsite.dk>
Subject: Re: how to find out who I am
Date: Fri, 8 Aug 2003 17:35:01 +0000	[thread overview]
Message-ID: <1030808173501.ZM20832@candle.brasslantern.com> (raw)
In-Reply-To: <20030804194344.GA30657@spiegl.de>
In-Reply-To: <20030804231842.GA15136@spiegl.de>

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).


  parent reply	other threads:[~2003-08-08 17:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-04 19:43 Andy Spiegl
     [not found] ` <75FEBB10-C6B4-11D7-9809-000393A707CC@eziba.com>
2003-08-04 19:58   ` Andy Spiegl
2003-08-04 20:04 ` Fletch
2003-08-04 23:18   ` Andy Spiegl
2003-08-05  0:19     ` Fletch
2003-08-05  7:06       ` Thomas Köhler
2003-08-08 17:35     ` Bart Schaefer [this message]
2003-08-08 19:37       ` Andy Spiegl

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=1030808173501.ZM20832@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /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).