[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where is Bash Prompt Set??



On Wed, Feb 10, 2010 at 09:47:56PM -0600, Stan Hoeppner
wrote:
> 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.

The subtlty of the difference depends on the length of your
prompt. With a one character prompt, the difference is
glaring - 100% of the string.  I tend to colour the root
prompt differently to make it even more obvious.

> 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.

I've never met a bash that displays anything other than '#'
for '\$' in PS1. Can you give an example of one that does?

In terms of other shells, '#' is so common that one can
reasonably expect a reader to understand what it is trying
to denote. If in doubt, be explicit in your preamble.

Alas I do not have immediate access to esoteric UNIX systems
anymore, but a quick check of bash, zsh, csh, tcsh, ksh,
posh, dash, psh with Debian indicates that psh and sash do
not use '#' ('%' and '>' respectively); sh, csh,
bash, tcsh and ksh on Solaris all use '#'.


-- 
Jon Dowland

Attachment: signature.asc
Description: Digital signature


Reply to: