From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3) with ESMTP id DAA23260 for ; Wed, 10 Apr 1996 03:44:25 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA19234; Tue, 9 Apr 1996 13:25:38 -0400 (EDT) Resent-Date: Tue, 9 Apr 1996 13:25:38 -0400 (EDT) Date: Tue, 9 Apr 1996 13:25:23 -0400 (EDT) From: "Timothy J. Luoma" Reply-To: luomat@cedman.remote.Princeton.EDU To: rft@cg.tuwien.ac.at Cc: zsh-workers@math.gatech.edu Subject: Re: ZSH: How to detect remoteness? In-Reply-To: <9604031228.AA05668@raven.cg.tuwien.ac.at> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"Zj8Gi1.0.Si4.HsfQn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/900 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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 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 <<<<