Stop Using ./ as in ./scriptname (a quick addition to $PATH) Presented by Dave Mawdsley, DACS Member, Linux SIG Member March 21, 2012
[ http://technonstop.com/dot-slash-meaning-linux ] 1 Introduction This presentation is based on “The Meaning of dot slash for Running an Executable in Linux” by Abdullah Chougle at TechNonStop. [ http://technonstop.com/dot-slash-meaning-linux ] ./ decoded means . is the current directory and / is the directory path separator. When typing ./scriptname at the shell, you access and execute scriptname in the current directory.
My Old Script Execute Method 2 My Old Script Execute Method In the shell I would type ./d to access my main menu system.
Append the $PATH Variable 3 Append the $PATH Variable Here's what Abdullah suggested: Append the current directory to the PATH variable to include the . as follows: export PATH=$PATH:. So here is my new $PATH variable: (Note the dot at the end.) echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:.
My New Script Execute Method 4 My New Script Execute Method So now all I have to do to access my directory is to type just the d in my home folder where the d script resides. madmod@madmod-laptop:~$ d and my directory page comes up as before.
Stop Using ./ as in ./scriptname (a quick addition to $PATH) This OpenOffice.org Presentation 'pathfix.odp' can be downloaded from http://madmod.com/freebies.html