Created
November 28, 2018 06:31
-
-
Save shiumachi/3edfddf7ffc6828882dc4c03cfe0aadf to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# utility functions | |
# wait_seconds N | |
# sleep N seconds | |
# | |
function wait_seconds() | |
{ | |
func_name="wait_seconds" | |
if ! expr "$1" : '[0-9]*' > /dev/null ; | |
then | |
echo "${func_name} ERROR: argument is not number" >&2 | |
return | |
fi | |
for i in `seq $1`; do | |
echo "wait for `expr $1 + 1 - ${i}` seconds..." >&2 | |
sleep 1 | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment