Unix systems tend to be organized with different types of files spread over different directories. For example, executables are usually in directories called
/usr/local/bin, …); historically,
bin stood for binary, because the executables are binaries (machine code), but there can be scripts as well. Since there are several directories that contain executables, and it's useful to add and remove directories on the fly (e.g. to test a multi-executable application, you temporarily add it to the search path for executables), there is an environment variable for that:
PATH. When you execute a program by giving its name, the shell looks it up in the directories mentioned in the
PATH variable (it's a colon-separated list of directories).
The same mechanism exists for other types of files that some program is going to search for by name. Here are a few typical
PATH-like variables (note that the example paths that I give aren't exactly what you'll find on your system, there' just there to give an idea).
PATH: executables (e.g.
MANPATH: manual pages (e.g.
LD_LIBRARY_PATH: native code libraries (on Linux, in addition to the value of this variable, the lookup path typically contains
/lib and a few others). The name
LD comes from dynamic loader, the system component that loads libraries into dynamically linked executables.
PERL5LIB: Perl libraries (e.g.
PYTHONPATH: Python libraries (e.g.
TCLLIBPATH: TCL libraries (e.g.
So if your
pkg.tcl is a standalone executable, give it execution permissions and drop it somewhere in
$PATH. If it's a TCL library loaded by a TCL program, drop it somewhere in