0

I see that the path variable is defined in my .profile file, and not in my .bashrc file. I have not changed either file. When using a shell initiated from the terminal icon on my desktop GUI, I can still echo $PATH.

So, what I am asking is, is the reason I can do this because, when I clicked the icon on my desktop for the terminal, a login shell process forked to the non-login shell I am interacting with, so the non-login shell I am using inherited the environment of the login shell, which was sourced from .profile? Is this understanding correct?

5
  • Related question: askubuntu.com/questions/13077/is-profile-sourced-by-bash -- your ~/.profile might be sourced when you log in to the GUI desktop Mar 9, 2022 at 17:17
  • Also check the settings of your terminal: is it configured to launch a login shell? Mar 9, 2022 at 17:17
  • I think the answer to your question is a simple "yes", assuming that .profile exports PATH.
    – frabjous
    Mar 9, 2022 at 17:24
  • @glennjackman where is the best place to confirm if the terminal is configured to launch a login shell?
    – Matt Curry
    Mar 9, 2022 at 17:48
  • With the Gnome terminal: Edit -> Preferences; select a profile; Command tab; checkbox labelled "Run command as a login shell" Mar 9, 2022 at 18:27

0

You must log in to answer this question.

Browse other questions tagged .