January 2004
Intermediate to advanced
368 pages
7h 25m
English
One problematic issue with shell script development is the number of inconsistent data formats; normalizing them can range from tricky to quite difficult. Date formats are some of the most challenging to work with because a date can be specified in several different ways. Even if you prompt for a specific format, like "month day year," you're likely to be given inconsistent input: a month number instead of a month name, an abbreviation for a month name, or a full name in all uppercase letters.
For this reason, a function that normalizes dates, though rudimentary on its own, will prove to be a very helpful building block for subsequent script work, especially Script #7, Validating Date Formats.
#!/bin/sh ...
Read now
Unlock full access