Re: [OT] How to add fortune output to terminal
Bob Proulx <bob@proulx.com>:
> s. keeling wrote:
> > Another common practice is to set PS1 in .bash_profile, then call
> > .bashrc from .bash_profile.
> > if [ ! -z "$PS1" ]; then
>
> The PS1 is set by default for interactive shells and not set for
> non-interactive shells. So the test for $PS1 works without needing to
> set it. This is in the default Debian /etc/skel/.bashrc too.
Thanks, didn't know that. I've always clobbered PS1 first, not caring
what it was set to. I guess I should instead test to see if it's set
to what I set it to.
> > The intent being to not clutter up the environment any more than is
> > necessary.
>
> Note: Some versions of bash read the .bashrc when it determines that
> it is started over a remote shell. By splitting the .bashrc into an
> interactive and non-interactive section then aliases can be loaded
> over a remote shell and made available to the command while not
> breaking things for a non-interactive environment. Not that I would
> advocate doing that. The feature was removed from the bash upstream
> due to various problems. Debian Etch has patches specifically for
> this situation. See /usr/share/doc/bash/README.Debian.gz .
I distinctly remember this behaviour, and its subsequent
disappearance. Thanks for explaining that. I wondered why it had
disappeared.
--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://blinkynet.net/comp/uip5.html Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.
Reply to: