Re: another problem with bash PS1 handling

2009-10-19 Thread Chet Ramey
> 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='

Re: another problem with bash PS1 handling

2009-10-19 Thread Nils
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

Re: another problem with bash PS1 handling

2009-10-18 Thread Chet Ramey
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 "