Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!uakari.primate.wisc.edu!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.unix.xenix.sco Subject: Re: whoami? Message-ID: <2749@sixhub.UUCP> Date: 28 Dec 90 00:01:26 GMT References: <6537@crash.cts.com> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 19 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