Skip to content

Instantly share code, notes, and snippets.

@meysam81
Last active June 29, 2024 07:08
Show Gist options
  • Save meysam81/934ae579510a1e3922fbd56db65f2141 to your computer and use it in GitHub Desktop.
Save meysam81/934ae579510a1e3922fbd56db65f2141 to your computer and use it in GitHub Desktop.
#!/bin/bash
total_seconds=0
while true; do
((total_seconds++))
printf -v time_string "%dd %dy %dm %dw %dd %dh %dm %ds" $((total_seconds / 290304000)) $((total_seconds % 290304000 / 29030400)) $((total_seconds % 29030400 / 2419200)) $((total_seconds % 2419200 / 604800)) $((total_seconds % 604800 / 86400)) $((total_seconds % 86400 / 3600)) $((total_seconds % 3600 / 60)) $((total_seconds % 60))
echo "${time_string// 0[dymwdhs]/} passed"
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment