#Bash, 62 bytes
Bash, 62 bytes
c='|/-\';for((;;)){ echo Loading... ${c:d++%4:1}^[M;sleep .25;}
where ^[ represents ESC (ASCII 0x1b), which typically you can get by pressing CtrlV and then ESC.
ESC M is RI, reverse linefeed.
If you don't care about running indefinitely, you can save 2 bytes by using a recursive function:
c='|/-\';f(){ echo Loading... ${c:d++%4:1}^[M;sleep .25;f;};f
#Bash, 62 bytes
c='|/-\';for((;;)){ echo Loading... ${c:d++%4:1}^[M;sleep .25;}
where ^[ represents ESC (ASCII 0x1b), which typically you can get by pressing CtrlV and then ESC.
ESC M is RI, reverse linefeed.
If you don't care about running indefinitely, you can save 2 bytes by using a recursive function:
c='|/-\';f(){ echo Loading... ${c:d++%4:1}^[M;sleep .25;f;};f
Bash, 62 bytes
c='|/-\';for((;;)){ echo Loading... ${c:d++%4:1}^[M;sleep .25;}
where ^[ represents ESC (ASCII 0x1b), which typically you can get by pressing CtrlV and then ESC.
ESC M is RI, reverse linefeed.
If you don't care about running indefinitely, you can save 2 bytes by using a recursive function:
c='|/-\';f(){ echo Loading... ${c:d++%4:1}^[M;sleep .25;f;};f
#Bash, 62 bytes
c='|/-\';for((;;)){ echo Loading... ${c:d++%4:1}^[M;sleep .25;}
where ^[ represents ESC (ASCII 0x1b), which typically you can get by pressing CtrlV and then ESC.
ESC M is RI, reverse linefeed.
If you don't care about running indefinitely, you can save 2 bytes by using a recursive function:
c='|/-\';f(){ echo Loading... ${c:d++%4:1}^[M;sleep .25;f;};f