O'Reilly logo

Linux® Desk Reference, Second Edition by Scott Hawkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Shell Programming

Calling this section “Shell Programming” is sort of misleading. Strictly speaking, any command that works with the shell can be part of a shell script. The commands are featured here because they are rarely used outside of a script.

The commands covered in this section deal primarily with the flow of control statements, for example, –if, case, while, and foreach. Also covered are statements such as eval, which deal with the evaluation of arguments.

First Line

By convention, UNIX shell scripts should all begin with a line like the following:

#!/bin/tcsh

The first two characters (#!) tell the operating system that the contents of this file are intended to be a shell script. The remaining characters are the absolute path of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required