Skip to content

Instantly share code, notes, and snippets.

@mdpuma
Created March 16, 2018 20:20
Show Gist options
  • Select an option

  • Save mdpuma/5e58d42bc08ddab136dbb4e3ac89865d to your computer and use it in GitHub Desktop.

Select an option

Save mdpuma/5e58d42bc08ddab136dbb4e3ac89865d to your computer and use it in GitHub Desktop.
sleep_until.sh
#!/bin/bash
current_time=$(date +%s)
target_time=$(date -d "$*" +%s)
seconds=$(( $target_time - $current_time ))
echo "sleeping $seconds (`date -d "$*"`)"
sleep $seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment