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 fails in ksh93
and POSIX shell.

Reply via email to