26.1. Creating hold files

Any script needs to be able to create temporary or log files. When running scripts that do backups, it is generally good practice to keep a log of the actual backup. These are usually kept in a filesystem for a few weeks and then purged by age.

When developing scripts you will be continuously creating temporary files. Temporary files are also used in normal running scripts which hold information prior to being used for input into another process. One can also use cat to display a temporary file to the screen or send it to the printer.

26.1.1. Using date to create log files

When you want to create a log file, it is always a good idea to make it unique for that day or even hour. To do this the date command comes to our ...

Get Linux and Unix Shell Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.