Created
August 29, 2017 16:50
-
-
Save anthonyclarka2/b0ec0ed4aaa67b5fe0eeb26e3823c2ce to your computer and use it in GitHub Desktop.
BitBar script to pretty-print the Unix Epoch time, comma separated
This file contains 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 | |
# <bitbar.title>Pretty Epoch Time</bitbar.title> | |
# <bitbar.version>v1.0</bitbar.version> | |
# <bitbar.author>Anthony Clark</bitbar.author> | |
# <bitbar.author.github>anthonyclarka2</bitbar.author.github> | |
# <bitbar.desc>Displays epoch (unix) time separated by commas.</bitbar.desc> | |
# <bitbar.image>http://i.imgur.com/ltLqOcy.png</bitbar.image> | |
EPOCH=$(/bin/date +%s | /usr/local/opt/gnu-sed/libexec/gnubin/sed ':a;s/\B[0-9]\{3\}\>/,&/;ta') | |
echo "{" "${EPOCH}" "}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment