9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Where to set environments in p9p
@ 2008-03-27  5:20 Hongzheng Wang
  2008-03-27  5:45 ` sqweek
       [not found] ` <c4a46c570803270055p692f449frf021f3f0edf15d22@mail.gmail.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Hongzheng Wang @ 2008-03-27  5:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] Where to set environments in p9p
  2008-03-27  5:20 [9fans] Where to set environments in p9p Hongzheng Wang
@ 2008-03-27  5:45 ` sqweek
       [not found] ` <c4a46c570803270055p692f449frf021f3f0edf15d22@mail.gmail.com>
  1 sibling, 0 replies; 3+ messages in thread
From: sqweek @ 2008-03-27  5:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Thu, Mar 27, 2008 at 2:20 PM, Hongzheng Wang <wanghz@gmail.com> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] Where to set environments in p9p
       [not found] ` <c4a46c570803270055p692f449frf021f3f0edf15d22@mail.gmail.com>
@ 2008-03-27  8:44   ` Hongzheng Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Hongzheng Wang @ 2008-03-27  8:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thank you all, sqweek and arvindh :-)

I think the most convenient method, for me, is still modifying the 9
script and call p9p programs through 9 when necessary.  I said that is
due to my consideration: I hope I can stick with bash (I like its
readline support) and also play with p9p programs in almost all cases
(including sudo where the many non-standard configurations would be
ignored, say $PATH, by default).

To be specific, I add necessary settings in 9 script, and link it to
/usr/local/bin/9.  Then I can invoke p9p programs by 9 script, for
example, by `sudo 9 sam'.

--
HZ


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-27  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-27  5:20 [9fans] Where to set environments in p9p Hongzheng Wang
2008-03-27  5:45 ` sqweek
     [not found] ` <c4a46c570803270055p692f449frf021f3f0edf15d22@mail.gmail.com>
2008-03-27  8:44   ` Hongzheng Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).