whoami?

John C. Archambeau jca at pnet01.cts.com
Sat Dec 29 17:36:02 AEST 1990


davidsen at sixhub.UUCP (Wm E. Davidsen Jr) writes:
>In article <6537 at crash.cts.com> jca at pnet01.cts.com (John C. Archambeau) writes:
>
>| if (`whoami` == "root") then
>|  set prompt = "#"
>| else
>|  set prompt = "%"
>| endif
>| 
>| Something like that.  Somebody gave me a code fragment in e-mail that does
>| return what I want, but shell scripts bomb.  Any idea why?
>
>  Because it sets the prompt for the shell running the script and all
>commands run by it, but not in the environment of the interractive
>shell. You need to run the shell script with '.' or put it in the .profile.
>-- 
>bill davidsen - davidsen at sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
>    sysop *IX BBS and Public Access UNIX
>    moderator of comp.binaries.ibm.pc and 80386 mailing list
>"Stupidity, like virtue, is its own reward" -me


Wait a minute.  Doesn't the .cshrc apply to the C-Shell being started up and
affects the environment of the started C-Shell?  I know this is the case for
BSD/SunOS.  Is this just an idiosyncrasy of the Xenix C-Shell?


     // JCA

 /*
 **--------------------------------------------------------------------------*
 ** Flames  : /dev/null                     | What to buy?
 ** ARPANET : crash!pnet01!jca at nosc.mil     | EISA or MCA?
 ** INTERNET: jca at pnet01.cts.com            | When will the bus wars end?
 ** UUCP    : {nosc ucsd hplabs!hp-sdd}!crash!pnet01!jca
 **--------------------------------------------------------------------------*
 */



More information about the Comp.unix.xenix.sco mailing list