Skip to content

Instantly share code, notes, and snippets.

@andreasvirkus
Created May 6, 2018 05:58
Show Gist options
  • Save andreasvirkus/1f3ef25a93132d146e17103ed4be86e1 to your computer and use it in GitHub Desktop.
Save andreasvirkus/1f3ef25a93132d146e17103ed4be86e1 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Print string in an X
for ((i=${#1}-1; i>=0; i--)); do
printf "%$((${#1}-i+1))s\\r%b%s\\n" \
"${1:$((max-i-1)):1}" "\\033[$((i+1))C" "${1:$i:1}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment