Skip to content

Instantly share code, notes, and snippets.

@markuszeller
Last active April 11, 2023 12:31
Show Gist options
  • Save markuszeller/d0fc40e3db9caef2bfdf1c148e59c0bc to your computer and use it in GitHub Desktop.
Save markuszeller/d0fc40e3db9caef2bfdf1c148e59c0bc to your computer and use it in GitHub Desktop.
Bash tricks

60 Seconds backwards timer with counter

i=60;while [ $((i--)) -gt 0 ]; do printf "\r%02d" $i;sleep 1;done;echo

300 Seconds countdown with spinner

i=300;while [ $((i--)) -gt 0 ]; do for s in / - \\ \|; do printf "\r%03d %s" $i $s;sleep .25;done;done;echo

Import .env file into current shell

export $(xargs < .env)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment