Explicitly stating a path to an executable will make the shell try to use that path to execute the executable.
./myscript and if
myscript is not in the current directory, then you will get a "no such file or directory" error. This does not use the
$PATH should be a
:-delimited list of directories (not files) in which the shell will search for executables when no path is specified on the command line. It is a potential security risk to add the current directory (
.) to the
PATH variable (see "Is it safe to add . to my PATH? How come?").
Another simple solution for when you just want to have access to a single executable outside of you ordinary
$PATH is to use an alias:
(this goes in your shell initialization file, probably
You should specify the full absolute path to the executable in the alias.