1.5.4. A word on order and logic
In order to speed up the developing process, the logical order of a program should be thought over in advance. This is your first step when developing a script.
A number of methods can be used; one of the most common is working with lists. Itemizing the list of tasks involved in a program allows you to describe each process. Individual tasks can be referenced by their item number.
Using your own spoken language to pin down the tasks to be executed by your program will help you to create an understandable form of your program. Later, you can replace the everyday language statements with shell language words and constructs.
The example below shows such a logic flow design. It describes the rotation of log files. This example shows a possible repetitive loop, controlled by the number of base log files you want to rotate:
Do you want to rotate logs?
If yes:
Enter directory name containing the logs to be rotated.
Enter base name of the log file.
Enter number of days logs should be kept.
Make settings permanent in user's crontab file.
If no, go to step 3.
Do you want to rotate another set of logs?
If yes: repeat step 1.
If no: go to step 3.
Exit
The user should provide information for the program to do something. Input from the user must be obtained and stored. The user should be notified that his crontab will change.
* License

