Article Listing 1 Listing 2 Sidebar 1 may93.tar

Sidebar: Good Practice

The meat of the which script begins with a test. The [ is actually the name of a program. The [ program is a hard link to the test(1) program. When [ is used, a ] is expected to terminate the argument list. A space must follow the [ because it is a program name and arguments are expected to be separated by spaces. Similarly, a space must precede the close bracket so the [ program will know it has reached the last argument. Otherwise, everything is the same as the test program.