The while control structure (see page 405 for tcsh) has the following syntax:
while test-commanddo commandsdone
As long as the test-command (Figure 10-5) returns a true exit status, the while structure continues to execute the series of commands delimited by the do and done statements. Before each loop through the commands, the structure executes the test-command. When the exit status of the test-command is false, the structure passes control to the statement after the done statement.
The following shell script first initializes the number variable to zero. The test builtin then determines ...