On Thu, 5 Jul 2018 16:59:21 +0100
Peter Percival wrote:
> Ahem A Rivet's Shot wrote:
> > On Thu, 5 Jul 2018 15:42:43 +0100
> > Peter Percival wrote:
> >
> >> Thank you. I have added . to PATH and it now works.
> >
> > I hope you put it at the end.
>
> I did. It now seems it shouldn't be there at all and I need a ~/bin
> directory for my executables.
It all depends on what you want to achieve:
A ~/bin directory on the path is a great place to keep finished (or
at least the latest good version) of your own scripts and programs. It
makes them available to you no matter what your current directory and helps
keep the last known good version from being broken by an ill-considered
improvement attempt. It's useful in multi-user environments where several
people may have scripts with the same name that do different things
(think students doing exercises for example).
A /usr/local/bin directory on the path is a great place to keep
finished (etc.) scripts and programs that you want to be available to all
user ids (which may or may not be human users).
The current directory (when working on a program) is probably where
you'll have the latest work-in-progress incarnation which may or may not
work well. Having . on the path saves a little typing with this but has the
disadvantage that if you need to run the last known good version instead of
the work-in-progress then you'll need the full path.
Another use for having . (or ./bin or similar) on the path is to
make the same script name context (ie. current directory) sensitive which
can be a neat trick sort of like OO with the script name as the method name
and the directory as the class. The one time I did something like this it
was for a directory based persistent object setup with a .class symlink to
the class directory and a .properties file contained the JSON encoded
instance properties. The class directories all had a bin subdirectory so
the path included ./class/bin rather than . it was an interesting approach
to a persistent object store that worked quite well. Of course those paths
were purely internal use they didn't get into any user paths.
For most purposes though having . in the path is slightly more
trouble than it's worth and occasionally a RPITA so most of us don't do it.
--
Steve O'Hara-Smith | Directable Mirror Arrays
C:\>WIN | A better way to focus the sun
The computer obeys and wins. | licences available see
You lose and Bill collects. | http://www.sohara.org/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|