Skip to content

Instantly share code, notes, and snippets.

@anthonyclarka2
Created August 29, 2017 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonyclarka2/b0ec0ed4aaa67b5fe0eeb26e3823c2ce to your computer and use it in GitHub Desktop.
Save anthonyclarka2/b0ec0ed4aaa67b5fe0eeb26e3823c2ce to your computer and use it in GitHub Desktop.
BitBar script to pretty-print the Unix Epoch time, comma separated
#!/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