Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: how to find out who I am
- X-seq: zsh-users 6459
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: ZSH User List <zsh-users@xxxxxxxxxx>
- Subject: Re: how to find out who I am
- Date: Fri, 8 Aug 2003 17:35:01 +0000
- In-reply-to: <20030804194344.GA30657@xxxxxxxxx>
- In-reply-to: <20030804231842.GA15136@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030804194344.GA30657@xxxxxxxxx> <m23cghdwa7.fsf@xxxxxxxxxxxxxxxxxxxx> <20030804231842.GA15136@xxxxxxxxx>
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).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author