zsh-workers
 help / color / mirror / code / Atom feed
From: "Timothy J. Luoma" <luomat@cedman.remote.Princeton.EDU>
To: rft@cg.tuwien.ac.at
Cc: zsh-workers@math.gatech.edu
Subject: Re: ZSH: How to detect remoteness?
Date: Tue, 9 Apr 1996 13:25:23 -0400 (EDT)	[thread overview]
Message-ID: <Pine.NXT.3.92.960409131439.12749K-100000@capitalist.princeton.edu> (raw)
In-Reply-To: <9604031228.AA05668@raven.cg.tuwien.ac.at>


I am also using NeXTStep, and zsh (obviously ;-)

I have recently devised this as a (foolproof?) way to check to see if you
are local or remotely logged in:

This goes at the top of my .zshenv

APPNAME=`/bin/ps -axlcw | awk '{ pid=$3; ppid[pid]=$4; \
name[pid]=$NF; } END { pid='$$';\
while (name[pid]==name[ppid[pid]]) pid=ppid[pid]; \
print name[ppid[pid]]; }'`

case $APPNAME in
	telnetd)
		# do stuff for telnet login
	;;

	rshd)
		# do stuff (or nothing) for rsh
	;;

	inetd)
		# if you use RBrowser.app for NeXTStep
	;;

	Terminal|Stuart)
		# this probably means you are on console
	;;

	*)
		# dunno how you'd get here
	;;

Actually, I have mine setup so that if it isn't rshd/telnetd/inetd then
assume I am on console...

Ohh.. you may want to check for 'ftpd' also.... I hadn't thought about
that before...

Let me know if you need any help with this.

TjL

--
Timothy J. Luoma 	<luomat@capitalist.princeton.edu>
USENET: Please CC this address on replies to my posts, things vanish fast.
NeXT Info available via email! 	Send message with SUBJECT 'send info'
>>>> Please: No NeXTMail, use MIME for attachments <<<<





      parent reply	other threads:[~1996-04-09 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-03 12:28 Robert F Tobler
1996-04-03 18:40 ` Eskandar Ensafi
1996-04-09 17:25 ` Timothy J. Luoma [this message]

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=Pine.NXT.3.92.960409131439.12749K-100000@capitalist.princeton.edu \
    --to=luomat@cedman.remote.princeton.edu \
    --cc=rft@cg.tuwien.ac.at \
    --cc=zsh-workers@math.gatech.edu \
    /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).