On 01/06/11 23:10, Ezequiel Garzsn wrote:
> Greetings. This is my first post to the OpenBSD community, so please
> let me know if I'm in the wrong list, this is just too basic or any
> other faux pas.
> 
> Under the default ksh, the default /root/.profile and indeed a
> completely fresh 4.8 install, adding the following line to
> /root/.profile does not work as expected:
> 
> export PS1='$PWD '

>From ksh(1):

     PS1        The primary prompt for interactive shells.  Parameter,

                /.../

                The default prompt is `$ ' for non-root users, `# ' for root.
                If ksh is invoked by root and PS1 does not contain a `#'
                character, the default value will be used even if PS1 already
                exists in the environment.

/Alexander


> 
> The login shell is '/root ', which makes sense to me, but all child
> shells get the default '# ', despite PS1 being exported. Even more
> strange, this doesn't happen when PS1 contains '\$' or '#'; it looks
> like the hash must be in the root prompt. Non-root users are not
> affected by the equivalent restriction (PS1 may not contain '\$' or
> '$').
> 
> Could anyone point out why this happens? Can this behavior be
> modified? Coming from a fresh install, there is no /etc/profile or
> /root/.kshrc.
> 
> Thank you in advance for your help.
> 
> Cheers,
> 
> Ezequiel

Reply via email to