bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defaults -- any


From: L A Walsh
Subject: Re: Defaults -- any
Date: Tue, 30 Mar 2021 09:54:35 -0700
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

On 2021/03/29 20:04, Greg Wooledge wrote:
On Mon, Mar 29, 2021 at 07:25:53PM -0700, L A Walsh wrote:

   I have both /etc/profile and /etc/bashrc call my configuration
scripts.  Are there common paths that don't call one of those?

A vanilla bash compiled from GNU sources with no modifications will
not source /etc/bash.bashrc or /etc/bashrc or any other such file.
----

   So this manpage text is wrong (focusing on paths in /etc):

   When  bash is invoked as an interactive login shell, or as a non-inter-
   active shell with the --login option, it first reads and executes  com-
   mands  from  the file /etc/profile.      Please note that the file
/etc/profile includes an autodetection shell code w(h)ether it has to
   source /etc/bash.bashrc.

   When  bash is invoked as an interactive login shell, or as a non-inter-
   active shell with the --login option, it first reads and executes  com-
   mands  from  the file /etc/profile, if that file exists.
   Please note that the file /etc/profile includes an autodetection
   shell  code w(h)ether  it  has  to source /etc/bash.bashrc.


The SYS_BASHRC feature is off by default, and must be enabled at
compile time.  Many Linux distributions enable it, but there are
surely systems with bash installed which have not enabled it.  So
that's one thing.
----
   Not really pertinent how my distro compiles bash, as it's on my
short list of programs I compile myself.


a graphical Display Manager does not read /etc/profile.
---
   SGI, took pains to have the graphical display manager read the login
scripts. I think suse does as well. I login with a Windows GUI (it doesn't)
read *nix login scripts.

   I require a specific environment to be setup in my shells or things
don't function the way I want.

   This is true whether I log in as root or as a normal user.



So that's the second thing.  Now imagine a system with a vanilla bash,
and a Display Manager login.
----
   Are you sure about that vanilla thing?  In my shell script that calls
configure, my enable/disable/with and without items are put into arrays
for later expansion.  Just looking at those:

if [[ $pkg == bash ]]; then
 declare -a enable=( alias arith-for-command array-variables
   brace-expansion casemod-attributes casemod-expansions command-timing
   cond-command cond-regexp coprocesses debugger directory-stack
   disabled-builtins dparen-arithmetic extended-glob
   extended-glob-default glob-asciiranges-default help-builtin
history job-control multibyte net-redirections process-substitution progcomp prompt-string-decoding readline
   select single-help-strings static-link )

 declare -a disable=(nls rpath )

 # declare -a with=( curses pic gnu-malloc ltdl-lib=/usr/lib64)
declare -a with=( gnu-ld )

 declare -a without=(bash-malloc)
else ## readline
----

Which item is responsible for enabling processing of
/etc/bash.bashrc and /etc/profile?  I'm pretty sure I don't know
which item it is...(sorry).  FWIW, I know net-redirections on linux
is wishful thinking.

Thanks!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]