Epoch Time shell script
Shell scripts
A shell script has a myriad of purposes on a Linux box. You can have them run at bootup so that they initiate commands or processes without you having to manually start them. They can be used to run a sequence of events. They can manipulate files, execute a program, print text, and walk your dog. Well, the last part is true if your dog is a robot. However, we're getting ahead of ourselves.
Epoch time, more commonly known as UNIX time (also POSIX time), is widely used in Linux (UNIX) systems as a way to describe instants in time. Specifically, it measures the number of seconds that have elapsed since January 1, 1970, and is used as a timestamp reference point.
With this shell script, we can quickly compare the Epoch time on our machine with the UTC that we are more accustomed to using.
How to do it...
Perform the following steps:
Unix time can be checked on most Unix systems by typing date +%s
on the command line. Perform the following steps:
First, create...