> Whether POSIX applies or not, from a logical standpoint history number
> and custom bash escape expansion should be last, after parameter
> expansion and command substitution because doing it first breaks
> command substitution (see my earlier post) or using variables in a
> prompt (a='!'; PS1='
On 19 Okt., 02:56, Chet Ramey wrote:
> Second, there are a couple of problems with Posix and this construct.
> You can make an argument that Posix doesn't apply, since it only
> calls for parameter expansion on the value of PS1, and that does not
> include command substitution. Even if it does ap
Nils wrote:
> PS1='$( [ "${LOGNAME}" != root ] && color=green )'
>
> works in ksh93 and POSIX shell but fails in bash as bash seems to
> expand the "!" to the next history file number before doing command
> substitution. Setting PS1='$( [ "${LOGNAME}" !!= root ] &&
> color=green )' preserves the "
PS1='$( [ "${LOGNAME}" != root ] && color=green )'
works in ksh93 and POSIX shell but fails in bash as bash seems to
expand the "!" to the next history file number before doing command
substitution. Setting PS1='$( [ "${LOGNAME}" !!= root ] &&
color=green )' preserves the "!" and works in bash but