Table of Contents

unix Keyword 2

shabang

Definition

A shabang is this: #! The shabang is used to read the following test on the first line after it to determine what interpreter the user would like to… use. Some example of interpreters (Taken directly from http://en.wikipedia.org/wiki/Shebang_(Unix):

References

unix Keyword 2 Phase 2

PATH environment variable

Definition

The $PATH variable specifies a list of one or more directory names separated by colons.

The /bin, /usr, and /local directories are typically included in most users' $PATH settings. The current directory is sometimes included, allowing programs in the current directory to be executed. Superuser (root) accounts as a rule are not include in $PATH, however, in order to prevent the accidental execution of scripts in the current directory.

When a command name is specified by the user or an exec call is made from a program, the system searches through $PATH, examining each directory from left to right in the list, looking for a filename that matches the command name. Once found, the program is executed as a child process of the command shell or program that issued the command.

References

http://en.wikipedia.org/wiki/PATH_%28variable%29

Demonstration

The following is an example of a $PATH:

lab46:~/src/opus/opus2$  

The $PATH The home directory (~/) is the beginning of this specified $PATH, followed by the src directory, then the opus directory, and lastly the opus2 directory.