whoami?

Wm E. Davidsen Jr davidsen at sixhub.UUCP
Fri Dec 28 11:01:26 AEST 1990


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



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