[9fans] Where to set environments in p9p - Plan9

This is a discussion on [9fans] Where to set environments in p9p - Plan9 ; Hi all, I have a question about the settings in p9p (plan 9 from user space), such as setting the default font ($font). According to the documents, $PLAN9/rcmain and $home/lib/profile are two places to put configurations stuff, say environments etc, ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [9fans] Where to set environments in p9p

  1. [9fans] Where to set environments in p9p

    Hi all,

    I have a question about the settings in p9p (plan 9 from user space),
    such as setting the default font ($font).

    According to the documents, $PLAN9/rcmain and $home/lib/profile are
    two places to put configurations stuff, say environments etc, which
    would be read by rc shell when invoked by `-l' option. But it is not
    convenient if we use default shell, say Bash, instead of rc.

    So, I wonder if there are some places to put these settings stuff so
    that all p9p programs would read them when started. Currently, I
    added them in the script `9'. I don't know if it is a good method.

    Thanks.

    --
    HZ


  2. Re: [9fans] Where to set environments in p9p

    On Thu, Mar 27, 2008 at 2:20 PM, Hongzheng Wang wrote:
    > I have a question about the settings in p9p (plan 9 from user space),
    > such as setting the default font ($font).


    Wherever you want. The environment is not something p9p specific, and
    how it gets initialised in somewhat dependent on your shell, OS, and
    distribution.

    > According to the documents, $PLAN9/rcmain and $home/lib/profile are
    > two places to put configurations stuff, say environments etc, which
    > would be read by rc shell when invoked by `-l' option. But it is not
    > convenient if we use default shell, say Bash, instead of rc.


    You're right, rc is beautifully simple compared to bash.
    It goes something like this:
    bash login shell: reads /etc/profile and ~/.bash_profile
    bash interactive non-login shell: reads ~/.bashrc
    bash non-interactive non-login shell: reads nothing unless you've set BASH_ENV.

    If you run /bin/sh instead of /bin/bash these rules totally change.
    You'll find the details in bash(1) (maybe).
    -sqweek


+ Reply to Thread