[indiana-discuss] Code review request

Roland Mainz roland.mainz at nrubsig.org
Thu Jan 31 18:13:11 PST 2008


David.Comay at Sun.COM wrote:
> > 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.

Ok... is it possible to rename it to "local.bashrc" (to match the naming
scheme for this kind of files in OS/Net) and/or at least put a comment
inside that bash syntax is allowed here ?
BTW: The seperate "export" statement is not neccesary - POSIX shells
allow things like $ export FOO=bar # (which is usually more efficient
than first creating a variable and then running "export" seperately)

> > 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.

Thanks! ... please poke me if you hit any problems (and please remove
the "export PS1" - PS1 should remain a local variable of the current
interactive shell session, exporting it into the environment will affect
other shells and scripts and that's AFAIK not intended in this case) ...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)


More information about the indiana-discuss mailing list