Skip to content

Instantly share code, notes, and snippets.

@nobiki
Created May 30, 2020 17:38
Show Gist options
  • Save nobiki/6c7d372a5b22af193861b2e69aeb5482 to your computer and use it in GitHub Desktop.
Save nobiki/6c7d372a5b22af193861b2e69aeb5482 to your computer and use it in GitHub Desktop.
#!/bin/bash -eu
function spin() {
spinner="/|\\-/|\\-"
while :
do
for i in `seq 0 7`
do
echo -n "${spinner:$i:1}"
echo -en "\010"
sleep 0.1
done
done
}
function run() {
echo -n "${1} ................... "
spin &
SPIN_PID=$!
trap "kill -9 $SPIN_PID" `seq 0 15`
. ./${1}.sh 1>/dev/null
echo "Done (${?})"
kill -9 $SPIN_PID
}
run test-include
run test-include
echo aaaaaaa
sleep 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment