Created
September 12, 2018 13:36
-
-
Save jb0hn/222ab629b98c8fd8a2c69a71a5e448e0 to your computer and use it in GitHub Desktop.
Loading bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 #!/bin/bash | |
2 | |
3 for i in {0..25} | |
4 do | |
5 # printf prints command in the same line; echo does not | |
6 # first slash inform bash that the second one is simple sign | |
7 printf "\\" | |
8 # this command allows to clear the command line and start pr inting from the begin | |
9 echo -ne "\r" | |
10 # do nothing for 0.15 second | |
11 sleep 0.15 | |
12 printf "/" | |
13 echo -ne "\r" | |
14 sleep 0.15 | |
15 printf "-" | |
16 echo -ne "\r" | |
17 sleep 0.15 | |
18 done | |
~ | |
~ | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment