Chapter 10. Programming the C and TC Shells

Programming the C and TC Shells

Introduction

The Steps in Creating a Shell Script

A shell script is normally written in an editor and consists of commands interspersed with comments. Comments are preceded by a pound sign (#) and consist of text used to document what is going on.

The First Line

At the top left corner, the line preceded by #! (often called shbang) indicates the program that will be executing the lines in the script.

#!/bin/csh or #!/bin/tcsh

The #!, also called a magic number, is used by the kernel to identify the program that should be interpreting the lines in the script. When a program is loaded into memory, the kernel ...

Get UNIX® Shells by Example Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.