Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ucbvax!hplabs!pyramid!infmx!aland From: aland@infmx.UUCP (Dr. Scump) Newsgroups: comp.unix.questions Subject: Re: YAPQ (yet another prompt question) Summary: sh is probably the default shell for root Message-ID: <2113@infmx.UUCP> Date: 15 Aug 89 03:04:24 GMT References: <1356@unhd.unh.UUCP> Reply-To: aland@infmx.UUCP (alan denney) Organization: INFORMIX Professional Services ("Peace thru Normalization") Lines: 44 In article <1356@unhd.unh.UUCP> rg@unh.UUCP (Roger Gonzalez) writes: | |Since a child 'csh' is spawned whenever I 'su', I thought it would be |nice to have the prompt reflect the 'su-ed' state. Hence, in .cshrc, I |had: | |(assume $host = 'iron' and $user1 = 'rg') | |.. |set user2 = `whoami` |if ($user2 == 'root') then | set suffix = '# ' |else | set suffix = '% ' |endif | |if ($user1 == $user2) then | set prompt = $host':'$user1$suffix |else | set prompt = $host':'$user1' ('$user2')'$suffix |endif |.. | |What wanted is thus "iron:rg% " for my normal state, and "iron:rg (root)# " |when I 'su'. | |The first instance works, but when I su I get: |error in set (or something similar) |iron:rg_ | |Roger Gonzalez Did you try su-ing to uid that definitely has csh as its shell? I suspect that root on your system uses sh by default. sh(1) would gag on the "set prompt" command, as it is not valid set syntax for sh. -- Alan S. Denney @ Informix Software, Inc. {pyramid|uunet}!infmx!aland "I want to live! -------------------------------------------- as an honest man, Disclaimer: These opinions are mine alone. to get all I deserve If I am caught or killed, the secretary and to give all I can." will disavow any knowledge of my actions. - S. Vega