[indiana-discuss] bash: printf: `B': invalid format character

Shawn Walker swalker at opensolaris.org
Mon Jun 2 06:06:50 PDT 2008


2008/6/2 Petr Skovron <petr.skovron at sun.com>:
> Hello,
>
>     I noticed that the .bashrc of the user account created during the
> installation causes the following misbehaviour:
>
> ps216548 at v64-x2100-prg06.czech:~$ mkdir FOO%BAR
> ps216548 at v64-x2100-prg06.czech:~$ cd FOO%BAR/
> bash: printf: `B': invalid format character
> ps216548 at v64-x2100-prg06.czech:~/FOO_
>
> The problem is that in .bashrc PS1 is set as follows:
>
> PS1='${LOGNAME}@$(hostname):$(
>    [[ "$LOGNAME" = "root" ]] && printf "${PWD/${HOME}/~}# " ||
>    printf "${PWD/${HOME}/~}\$ ")'
>
> This usage of printf is improper.  Is this a known bug?  (Where does
> the .bashrc come from at all?  I didn't find it in /etc/skel.)

It is a known bug. I filed something on this on defect.opensolaris.org.

I think if you search for printf you'll find it.

-- 
Shawn Walker



More information about the indiana-discuss mailing list