Shell Scripts
Articles in this part are about shell scripting on Linux.
- Details
Looking for a clever way to display purpose and usage information to the caller of your shell script? What I describe here is a way to use the documentation that may already be there for just this purpose.
A good programmer puts some effort in good documentation of the software. Scripts should be no exception. So, you start your shell scripts with a couple of comment lines to describe the purpose of the script. You also document any parameters and exit values. Excellent.
Learn how to use this very description at the start of you shell script to display usage information to the user. You might do this when required parameters are missing, or if there is any error in the parameters provided.