Score:0

$PATH is different for startup programs

at flag

I have a .sh file with echo $PATH. When opening a terminal, the PATH is how it is supposed to be, it includes all the additions in .bashrc.

I open the startup menu and set this script to run on startup. But when it runs, the $PATH variable only has /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games. It should be much longer.

Things I've tried putting before the echo:

  • source ~/.bashrc
  • . ~/.bashrc
  • source ~/.profile
  • exec bash

Things I've tried for running the command itself:

  • konsole -e ...
  • bash -c ...
Score:1
cn flag

Changes to the PATH defined in ~/.bashrc will only be in effect in an interactive shell, i.e., every time you open a terminal. To have changes to a PATH take effect anytime you login to the desktop, include these changes in ~/.profile instead. That file is read for a login shell, thus after you log in to the system.

Sung Jinwoo avatar
at flag
I commented out the interactive shell check in .bashrc and that fixed it. But are there any problems I should be aware of with doing this?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.