Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!mips!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!ucsd!nosc!crash!pnet01!jca From: jca@pnet01.cts.com (John C. Archambeau) Newsgroups: comp.unix.xenix.sco Subject: Re: whoami? Message-ID: <6590@crash.cts.com> Date: 29 Dec 90 06:36:02 GMT Sender: root@crash.cts.com Organization: People-Net [pnet01], El Cajon CA Lines: 37 davidsen@sixhub.UUCP (Wm E. Davidsen Jr) writes: >In article <6537@crash.cts.com> jca@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@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@nosc.mil | EISA or MCA? ** INTERNET: jca@pnet01.cts.com | When will the bus wars end? ** UUCP : {nosc ucsd hplabs!hp-sdd}!crash!pnet01!jca **--------------------------------------------------------------------------* */