Download presentation
Presentation is loading. Please wait.
1
Stop Using ./ as in ./scriptname
(a quick addition to $PATH) Presented by Dave Mawdsley, DACS Member, Linux SIG Member March 21, 2012
2
[ 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. [ ] ./ 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.
3
My Old Script Execute Method
2 My Old Script Execute Method In the shell I would type ./d to access my main menu system.
4
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:.
5
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. d and my directory page comes up as before.
6
Stop Using ./ as in ./scriptname
(a quick addition to $PATH) This OpenOffice.org Presentation 'pathfix.odp' can be downloaded from
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.