From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15176 invoked by alias); 13 Mar 2014 01:15:52 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18594 Received: (qmail 15470 invoked from network); 13 Mar 2014 01:15:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140312181536.ZM13369@torch.brasslantern.com> Date: Wed, 12 Mar 2014 18:15:36 -0700 In-reply-to: <20140312232637.GA12697@panix.com> Comments: In reply to rj "can full hostname (instead of IP addr) be reported via 'watch'?" (Mar 12, 7:26pm) References: <20140312232637.GA12697@panix.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: can full hostname (instead of IP addr) be reported via 'watch'? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Mar 12, 7:26pm, rj wrote: } } Where I'm using 'watch', only the IP address is given in place of '%M'. } How would it be possible to have it report the actual host name instead of } the IP address? Does it depend on what's in the utmp or wtmp files? Yes, it depends on what is read from the utmp data structure. It's pretty much up to the system admin whether the reverse lookup on the IP address is done when the utmp entry is created; I would imagine that on some big shell-server hosts like Panix they avoid it to keep the network overhead down and the login process faster. There isn't any convenient way to work around this, WATCHFMT doesn't expand any other substrings the way e.g. prompts can be made to. You could set up something to periodically run the "log" builtin and postprocess the output ... or you could run another shell with zpty, whose only purpose is to emit watch output, and then monitor the pty with zle -F and postprocess whatever it spits out. But those are pretty much your only options.