Skip to content

Instantly share code, notes, and snippets.

@alexjh
Created January 10, 2014 21:25
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 alexjh/8362940 to your computer and use it in GitHub Desktop.
Save alexjh/8362940 to your computer and use it in GitHub Desktop.
Very annoying subtle bug!

This line was used to create a timestamp in /etc/rc.sysinit

echo $(($(date +'%s * 1000 + %N/1000000'))) > /tmp/timestamp

It created a very subtle bug, can you spot it?

The proper solution:

echo $(($(date +%s%N)/1000000))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment