help-bash
[Top][All Lists]
Advanced

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

Re: Getting the default post-initialisation PATH value at runtime


From: Greg Wooledge
Subject: Re: Getting the default post-initialisation PATH value at runtime
Date: Thu, 31 Mar 2022 09:34:48 -0400

On Thu, Mar 31, 2022 at 08:58:38PM +0800, Hu Jialun wrote:
> I came across this scenerio today: after accidentally setting PATH to
> something incorrect, I wanted to revert it to its default when bash
> started but was unable to find the default value.

The idea that a shell should save a copy of every variable's value at
the moment it begins accepting interactive commands, so that you could
switch back to this previous value in case you "accidentally" change it,
is quite bizarre.

The idea that a shell should do that, but only for "special" variables,
is even more bizarre.

If this is important to you personally, then you could edit your .bashrc
file to save copies of certain variables' values in other variables, or
even in a file, and then set up a revert function that you could call
to restore those values.



reply via email to

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