Created
February 28, 2020 22:13
-
-
Save Resisty/6a70ac5d336d5babe456f0ac924bb04c to your computer and use it in GitHub Desktop.
Awful Bash String Reverse
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
#!/usr/bin/env bash | |
# This was done as a joke at work when we were talking about interview questions. | |
# I am unashamed. | |
string="$1" | |
for (( i=0; i<${#string}; i++ )); | |
do | |
{ eval "sleep \$(expr \${#string} - \$i) && printf '%s' '${string:$i:1}'" & } 2>/dev/null | |
done | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment