Subject: Re: pkg/16226 (new patch for review)
To: <>
From: David Laight <>
List: tech-userlevel
Date: 01/18/2003 19:42:46
> I was criticizing the implementation decision: don't add junk to the C
> code when the scripting language is sufficient.  I expect the
> implementor of the fancy-prompt feature to "write all this stuff", not
> each newcomer who wants a fancy prompt.  For example: put cd_prompt()
> into a system-wide /etc/skel/.shrc.

Not only that, but the suggested 'prompt expansion' is contary to
posix - which /bin/sh attempts to meet - which says:

PS1 Each time an interactive shell is ready to read a command, the value of
    this variable shall be subjected to parameter expansion and written to
    standard error.  The default value shall be "$ " .  For users who have
    specific additional implementation-defined privileges, the default may
    be another, implementation-defined value.  The shell shall replace each
    instance of the character '!' in PS1 with the history file number of the
    next command to be typed.  Escaping the '!' with another '!' (that is,
    "!!" ) shall place the literal character '!' in the prompt.  This volume
    of IEEE Std 1003.1-2001 specifies the effects of the variable only for
    systems supporting the User Portability Utilities option.

Note that we don't expand '!' - which is a bug!
We also don't have PS4.
> As for speed, the cd_prompt() function I mentioned takes great care to
> use only builtin commands, so the speed difference should be
> negligible.

You really won't notice it.

> Lastly, I suspect that linux users who know how bash works will miss
> more bashisms than just prompt expansion -- but that's not an argument
> to make our /bin/sh a bash clone.

Too true - bash isn't a posix shell....


David Laight: