Re: Where is Bash Prompt Set??
Tom Furie put forth on 2/10/2010 12:17 AM:
> On Tue, Feb 09, 2010 at 11:22:03PM -0600, Stan Hoeppner wrote:
>
>> Maybe you misunderstood my example shell prompt code. Or maybe I'm just not
>> understanding what you're saying. Here, copy/pasted from a Putty terminal
>> session. Not a doc-file, but demonstrates your example nonetheless.
>>
>> [11:14:14][stan@greer]/etc/postfix$
>> [11:16:09][root@greer]/etc/postfix$
>>
>> There. No color. Root does has a different prompt. The prompt says "root"
>> instead of "user". What about your concern am I missing?
>
> I think the point is that it's a lot easier to overlook "root" buried
> somewhere in the middle of a long prompt than it is to overlook a "#"
> right next to the cursor.
An author of technical documentation should never rely on the ability of the
reader to pick up on the subtle one character difference of $ or # in a command
line example. Any command run by root should always be identified as such with
additional text. Additionally, bash is the default shell on many *nix
variants/distros, and far from all of them use # trailing the prompt to denote
root is currently logged into the shell. If one is writing cross-platform or
generic documentation, again, one should never rely on # or $ conveying to the
reader what user is logged into the shell. Always be explicit when teaching the
command line.
--
Stan
Reply to: