Xref: utzoo unix-pc.sources:325 comp.sys.att:6810 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!pacbell!att!cbnewsh!ho5cad!wjc From: wjc@ho5cad.ATT.COM (Bill Carpenter) Newsgroups: unix-pc.sources,comp.sys.att Subject: Re: KSHPR: prompt generator for .kshrc Message-ID: Date: 24 Jun 89 06:53:46 GMT References: <19817@cup.portal.com> Sender: bill@cbnewsh.ATT.COM Organization: AT&T Bell Laboratories Lines: 20 In-reply-to: thad@cup.portal.com's message of 23 Jun 89 12:28:53 GMT In article <19817@cup.portal.com> thad@cup.portal.com (Thad P Floryan) writes: > The following is a l'il qwik'n'dirty you may find useful. If you know of some > other method to determine whether one is running su'd or not, please share it. > This posting is to unix-pc.sources and comp.sys.att since it's of potential use > to any UNIX user of ksh. While not su-ed (like in .profile), create a file, e.g., /tmp/try. chmod 044 /tmp/try. (Obviously, you need a more unique filename.) Here's the test you asked for: if [ -r /tmp/try ] then echo I am su-ed else echo I am not su-ed fi -- Bill Carpenter att!ho5cad!wjc or attmail!bill