Skip to content

Instantly share code, notes, and snippets.

@loa
Created January 21, 2015 13:53
Show Gist options
  • Save loa/e5824fc2b14979b5ce38 to your computer and use it in GitHub Desktop.
Save loa/e5824fc2b14979b5ce38 to your computer and use it in GitHub Desktop.
Bash rotate cursor
#!/bin/bash
rotateCursor() {
s="-,\\,|,/"
for i in `seq 1 $1`; do
for i in ${s//,/ }; do
echo -n $i
sleep 1
echo -ne '\b'
done
done
}
# Single loop
rotateCursor
# 2 loops
rotateCursor 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment