In bash terminology, there is a difference between command-line arguments and flags. The following diagram clearly specifies the distinction between them:
Suppose that we have a command-line app called storeMarks for saving the marks of a student. It has a flag (called save) to specify whether details should be persisted or not. The arguments that are given are the name and actual marks of the student. We already saw how to collect the flag values in the program. In this section, we will learn how to collect program arguments in an expressive way. Follow these steps:
- For collecting arguments, we ...