0

My project uses an internal tool on Linux, that uses a file called .spacerc for configuring some environmental variables.

The strange thing is, whenever I start a (non-login interactive) bash shell - whether via PuTTy, or via executing $SHELL, or via a python script executing pty.spawn($SHELL) - it reads in .spacerc and sets the environmental variables as specified in it. (And yes, $SHELL is /bin/bash.)

It appears that .spacerc is read before .bashrc is executed (at least the one in the local user directory).

I can't find any info on line that indicates why bash would automatically read in an arbitrary file called .spacerc.

Why might this be happening?

Thanks!

9
  • 1
    Since this happens on non-login interactive shell,s your first step is to examine ~/.bashrc and, if it exists on your sysetm, /etc/bash.bashrc and see what they execute.
    – John1024
    Commented Apr 26, 2019 at 20:49
  • Nothing in any *bashrc* anywhere that refers to a .spacerc file, or that spawns any tool that might. Commented Apr 26, 2019 at 21:19
  • Also, just edited OP to add that it appears that .spacerc is read before .bashrc is executed. Commented Apr 26, 2019 at 21:28
  • Are these unwanted environment variables specific, as per the question, to "non-login interactive) shell shell" or do they occur for all shells?
    – John1024
    Commented Apr 26, 2019 at 21:48
  • 1
    Check all of the files listed in Zsh/Bash startup files loading order (.bashrc, .zshrc etc.) | The Lumber Room
    – DavidPostill
    Commented Apr 27, 2019 at 19:43

1 Answer 1

1

Mystery solved: The tool owner added a script to /etc/profile.d directory (which is executed on every shell start), that reads in the tool-specific configuration file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .