[Trisquel-users] how do I set a global PATH?
mtjm at mtjm.eu
Mon Sep 24 18:22:45 CEST 2012
> PATH is defined on several levels. "Child" processes inherit PATH from
> their "parents".
PATH is an environment variable. Each process has its own environment
which is copied into its children.
> I suppose:
> ~/.bash* belongs to a child process of the one defined in
> the /etc/profile.d belongs to a child of /etc/environment .
> Is this correct?
Shell processes run commands from various initialization files, bash
uses /etc/profile, ~/.bash_profile, ~/.bashrc and others depending on
how it's run (the manual explains this in detail). /etc/environment has
Most processes that a user runs are started (directly or indirectly)
From a shell.
> I like the solution with the extra fil in /etc/profile.d, but I have
> some questions first.
> 1. on what level is PATH defined here?
These files are sourced from /etc/profile which is sourced from login
shells when they start ("source" is a shell command for running commands
From a file in the same process; shell scripts are typically run in
> 2. can the file have any name?
It must end with ".sh".
> 3. what should be in the file? Just the same as I have added to by
> ~/.bashrc? (See above)
E.g. this line:
(or change PATH and export it on a separate line; export is needed since
otherwise it will be only a shell variable that isn't available to other
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 835 bytes
Desc: not available
More information about the Trisquel-users