[indiana-discuss] Code review request

David.Comay at Sun.COM David.Comay at Sun.COM
Thu Jan 31 17:58:58 PST 2008


> 1. putting the PS1 setting into /etc/profile is IMO not a good idea
> since this is 1) shell-specific,  2) belongs into the setup for
> _interactive_ shell sessions (/etc/profile is for login shells (and not
> all interactive shells are login shells and nothing says that login
> shells must be interactive)) and 3) will affect other people's script
> (PS1 should never be exported into the environment). AFAIK this stuff
> belongs into /etc/bash.bashrc or ~/.bashrc since it assumes bash's
> non-standard expansion for "\w" ; the matching ksh93 file is
> /etc/ksh.kshrc

Sorry, this particular file is poorly named in the slim_prototype
gate.  It's actually the contents of the .bashrc file installed for the
new user.  It's not copied into any system directories.

> 2. The "\w" must be escaped by an extra '\', otherwise you're ending-up
> with undefined behaviour (e.g. outside what the POSIX standard defines)
> of /usr/bin/printf (and the upcoming rework of /usr/bin/printf may then
> present you with an unexpected result or even an error message) (To be
> honestly I did the same mistake, that's why the new /usr/bin/printf will
> be less forgiving when someone tries to input reserved or malformed
> format patterns)
> 3. AFAIK the "\\w" can be replaced with "\$PWD" (or "\${PWD}") - making
> this more portable (e.g. it should work with bash and ksh93)

Thanks, I'll test this change out.

dsc


More information about the indiana-discuss mailing list