bug-bash
[Top][All Lists]
Advanced

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

Re: More convenient tracing


From: Greg Wooledge
Subject: Re: More convenient tracing
Date: Thu, 26 Jan 2023 13:00:18 -0500

On Thu, Jan 26, 2023 at 12:03:08PM -0500, Dale R. Worley wrote:
> I do have BASH_ENV set, to ~/.bashrc.  I need that so that my scripts
> can use my .bashrc customizations.

I strongly advise against this.  All of the things a script does should
be discoverable by reading the script, and any files that are explicitly
dotted in (sourced) by that script.

There shouldn't be any surprises coming in from the execution environment.

If your script needs external variables, it should explicitly dot in a
file that sets just those variables.  (Usually, /etc/default/ or ~/.config/
contains files of this type.)  Such a file should NOT be a user's .bashrc
because that can change on a whim, and may do things that the script
would neither expect nor desire.



reply via email to

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