Add help information upon misuse.
This commit is contained in:
15
countdown.sh
15
countdown.sh
@@ -22,16 +22,19 @@
|
|||||||
# 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 "Usage: $0 [COUNT]"
|
||||||
else
|
exit 1
|
||||||
COUNT=$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