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

Re: How To Permanently Add-to a Users PATH Statement in the Bash Shell



On Tue, Jul 07, 2020 at 09:57:34AM -0400, Stephen P. Molnar wrote:
> The Subject line is the problem with my Debian Buster platform. Now from
> Google I see that there has been a change in the way Debian handles this
> problem.
> 
I'm not sure what change you are referring to, but from what you
describe below I find it unlikely that anything has changed in the
observed behavior.

> My user path statement is:
> 
> comp@AbNormal:~$ echo $PATH
> /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
> 
> Now I have a number of applications that have multiple executable in the app
> /bin subdirectory. Hence the need to add to the users PATH statement
> 
> As an example I have:
> 
> /home/comp/Apps/ADFRsuite-1.0/bin
> 
> which I would like to add to the PATH statement and:
> 
> export PATH=$PATH:'/home/comp/Apps/ADFRsuite-1.0/bin'
> 
> This works unless I open a new Terminal, in which case it is no longer in
> the PATH.
> 
Opening a new terminal spawns a new process.  If the parent of the new
process is not the shell in which you executed the 'export' command,
then when the PATH variable is set based on the system and user
configuration files it will lack the additional value from the 'export'.

> How do I make the addition persistent?
> 
You should add the export command to ~/.bashrc (for it to only be in
effect for that user) or to /etc/bash.bashrc (for it to be in effect for
all users on the system).

Regards,

-Roberto

-- 
Roberto C. Sánchez


Reply to: