Last active
August 8, 2022 12:32
-
-
Save jmarcher/0f7534b50edaaa8339ac591e13a77b68 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
function divider() { | |
local _d=${3:-2} | |
local _n=0000000000 | |
_n=${_n:0:$_d} | |
local _r=$(($1$_n/$2)) | |
_r=${_r:0:-$_d}.${_r: -$_d} | |
echo $_r | |
} | |
function sort() { | |
sleep "$2" | |
echo "$1" | |
} | |
while [ -n "$1" ] | |
do | |
if [ "0" -gt "$1" ]; then | |
sort $1 "$(divider 1 $(($1 * -1)) 2)" & | |
else | |
sort $1 $(($1 +1)) & | |
fi | |
shift | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment