Created
July 21, 2014 18:24
-
-
Save viktorbenei/137e04edd4442547488b to your computer and use it in GitHub Desktop.
Example: Generate Unix timestamp in bash script on OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function getCurrentUnixTimestamp { | |
printf %s $(date +%s) | |
} | |
echo " (i) Generating current timestamp..." | |
current_unix_timestamp=$(getCurrentUnixTimestamp) | |
echo " Timestamp: $current_unix_timestamp" | |
echo " (i) Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment