January 2004
Intermediate to advanced
368 pages
7h 25m
English
Conciseness is the heart of Unix and has clearly affected its evolution in quite a dramatic manner. However, there are some areas where this zeal for succinctness can drive a sysadmin batty. One of the most common annoyances in this regard is the format required for resetting the system date, as shown by the date command:
usage: date [[[[[cc]yy]mm]dd]hh]mm[.ss]
Trying to figure out all the square brackets can be baffling, without even talking about what you do or don't need to specify. Instead, a shell script that prompts for each relevant field and then builds the compressed date string is a sure sanity saver.
#!/bin/sh # setdate - Friendly front end to the date command. # Date wants: [[[[[cc]yy]mm]dd]hh]mm[.ss] ...
Read now
Unlock full access