zsh-users
 help / color / mirror / code / Atom feed
From: Lists <lists@tntluoma.com>
To: zsh-users@sunsite.dk
Subject: Why can't I get my remote host into a variable?
Date: Wed, 30 Nov 2005 19:40:07 -0500	[thread overview]
Message-ID: <438E4667.6000307@tntluoma.com> (raw)


Zsh 4.2.5 on FreeBSD.  I'm ssh'ing into the FreeBSD machine.

I'm trying to get my remote host into a variable REMOTE_HOST.  I have 
tried both of these in .zshenv:

REMOTE_HOST=`who am i | awk '{print $NF}'|tr -d '(|)'`

$ who am i
luomat           ttyp0    Nov 30 19:34 (192.168.1.103)

That works on the commandline, but when I try it in .zshenv I get 
"19:34" or whatever the timestamp is for that session.

Thinking I would be clever, I tried this

TTYSHORT=`echo $TTY |colrm 1 8`
REMOTE_HOST=`w | fgrep $TTYSHORT | awk '{print $3}'`

but that does not work either.

Anyone know how to get this to work in .zshenv?






             reply	other threads:[~2005-12-01  0:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-01  0:40 Lists [this message]
2005-12-01  0:51 ` Geoff Wing

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=438E4667.6000307@tntluoma.com \
    --to=lists@tntluoma.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).