Skip to main content

Thread: Edit applications menu and PATHs


hi everybody. i'm new forums. have been using ubuntu couple of years, never posted before. i'm interested in understanding how stuff works.
searched in forums setting path , making change permanent, found bunch of instructions things done, little explanation.

correct me if state not right. when add path, via command line need export; example:

path=/whatever:$path
export path

when that, changes take place in current session, , after close it, changes gone. maybe question simple, why need export?, mean, first command above, succesfully add '/whatever' path, , possible run executable files inside '/whatever'.

second question is, read lot of posts in people add path end of file '.bashrc', others '.profile'. i'm running kubuntu 12.10, what's difference?, first cli , second valid gui?. writing inside these files, need add mentioned path , export, or path enough?

last question edit applications option in kde menu. have created launcher, , if specify absolute path executable in 'command'(general tab), program running without problems. if set working directory in advanced tab, '/whatever', expecting calling name of program in 'command' enough, execute not working. also, if have added path working directory, why can't call program name in 'command'?

thank in advance, , sorry english (non native speaker).
see around!!

in answer first question, 'export' builtin command exports variable environment. so, first command alters variable $path, while second exports variable $path environment (in case it's shell environment) shell can see newly changed variable. here's nice little guide on export command:

http://www.thegeekstuff.com/2010/08/...ltin-commands/

second question, assumption cli (the shell environment) vs gui environment correct. so, if want new path executed both gui , shell, should put in ~/.profile. so, example, there's built in support 'bin' directory inside $home directory (that is, if create directory called 'bin' inside of /home directory, when shell reloaded it'll pick , add $path. can see code inside of ~/.profile:

code:
# set path includes user's private bin if exists  if [ -d "$home/bin" ] ;      path="$home/bin:$path"  fi
it's saying, if there's 'bin' directory inside of $home, append current path. since profile loaded upon creation of new session, there's no need explicitly export new variable.

i'm not entirely sure launchers don't make them. however, if you've added path of binary (or executable script) $path in ~/.profile , you've made script or binary executable:

code:
chmod +x /whatever/yourscript #note: need 'sudo if /whatever not owned root
then think should able execute typing name. easiest case create $home/bin directory, add executable script, reload session, , try run command anywhere. quick way see if it's being picked correctly run:

code:
which script
where 'script' name of script in binary directory created. if created in $home/bin , result of above command gives similar output to:

code:
which example.sh   /home/<username>/bin/example.sh
then know it's working correctly, , typing 'example.sh' anywhere should work.

hope helps!


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Desktop Environments [SOLVED] Edit applications menu and PATHs


Ubuntu

Comments

Popular posts from this blog

Could not place because the source rectangle is empty

Thread: Using smartcard reader with vpnc

Adobe Font Folio 7.0 or just 7?