Sometimes you want a script that will step through the command-line arguments one by one. The Bourne shell for loop can do this. For an example of a for loop, let's hack on the the zpg script.
Control goes to the esac and the loop repeats with the next argument.
The next argument, afile , doesn't look like an option. So now the files variable will contain a space and afile . Next, we added another for loop. The loop runs gzcat on each file, piping it to pg with any switches you gave. Inc. All Rights Reserved.