In answer to your first question, the 'export' builtin command exports that variable to the environment. So, the first command alters the variable $PATH, while the second actually exports the variable $PATH to the environment (in this case it's the shell environment) so that the shell can see the newly changed variable. Here's a nice little guide on the export command:
http://www.thegeekstuff.com/2010/08/...ltin-commands/
To your second question, your assumption about CLI (the shell environment) vs the GUI environment is correct. So, if you want the new path to be executed by both the GUI and the shell, you should put that in ~/.profile. So, for example, there's already built in support for a 'bin' directory inside your $HOME directory (that is, if you create a directory called 'bin' inside of your /home directory, when the shell is reloaded it'll pick this up and add it to your $PATH. You can see that code inside of ~/.profile:
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
It's basically saying, if there's a 'bin' directory inside of $HOME, append it to the current path. Since profile is loaded upon creation of a new session, there's no need to explicitly export the new variable.
I'm not entirely sure about launchers as I don't usually make them. However, if you've added the path of the binary (or executable script) to your $PATH in ~/.profile and you've made the script or binary executable:
Code:
chmod +x /whatever/yourscript #NOTE: need 'sudo if /whatever is not owned by root
Then I think you should be able to execute it by simply typing the name. Probably the easiest case would be to create a $HOME/bin directory, add an executable script, reload the session, and try to run the command from anywhere. Also a quick way to see if it's being picked up correctly would simply be to run:
Where 'script' is the name of your script in the binary directory you created. If you created it in $HOME/bin and the result of the above command gives you similar output to:
Code:
which example.sh
/home/<username>/bin/example.sh
Then you know it's working correctly, and just typing 'example.sh' from anywhere should work.
Hope that helps!
Bookmarks