Compare commits
2 Commits
253bdcbecb
...
4240b99f84
| Author | SHA1 | Date | |
|---|---|---|---|
| 4240b99f84 | |||
| 6bc2145612 |
24
countdown.sh
24
countdown.sh
@@ -22,16 +22,28 @@
|
|||||||
# 3. This notice may not be removed or altered from any source
|
# 3. This notice may not be removed or altered from any source
|
||||||
# distribution.
|
# distribution.
|
||||||
|
|
||||||
if [ -z $1 ]
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ $# -gt 1 ]
|
||||||
then
|
then
|
||||||
COUNT=5
|
echo "Too many arguments"
|
||||||
else
|
echo "Usage: $0 [COUNT]"
|
||||||
COUNT=$1
|
exit 1
|
||||||
|
elif [ $# -eq 1 ] && [ "$1" = "-h" ]
|
||||||
|
then
|
||||||
|
echo "Usage: $0 [COUNT]"
|
||||||
|
exit 0
|
||||||
|
elif [ $# -eq 1 ] && [ "$1" -le 0 ]
|
||||||
|
then
|
||||||
|
echo "COUNT must be a positive integer"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in $(seq $COUNT -1 1)
|
COUNT=${1:-5}
|
||||||
|
|
||||||
|
for i in $(seq "$COUNT" -1 1)
|
||||||
do
|
do
|
||||||
echo $i
|
echo "$i"
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user