update count example
This commit is contained in:
parent
73300aaf18
commit
da3bffba6c
2 changed files with 5 additions and 5 deletions
|
|
@ -202,13 +202,13 @@
|
||||||
# Actual script
|
# Actual script
|
||||||
# ----------------------
|
# ----------------------
|
||||||
|
|
||||||
if [ "$N" -ge 11 ]; then # Use parsed positional argument
|
if [ "$N" -gt 10 ]; then # Use parsed positional argument
|
||||||
sferr "I can only count to/from 10" # Throw an error and exit
|
sferr "I can only count to/from 10" # Throw an error and exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
counter="$N" # Use parsed positional argument
|
counter="$N" # Use parsed positional argument
|
||||||
echo -n "$sftbf" # Print everyting from here bold
|
echo -n "$sftbf" # Print everyting from here bold
|
||||||
while [ "$counter" -ge 1 ]; do
|
while [ "$counter" -gt 0 ]; do
|
||||||
if [ "$reverse" == true ]; then # Use parsed flag
|
if [ "$reverse" == true ]; then # Use parsed flag
|
||||||
echo " $counter"
|
echo " $counter"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,13 @@ source "$(dirname $0)/../sf"
|
||||||
# Actual script
|
# Actual script
|
||||||
# ----------------------
|
# ----------------------
|
||||||
|
|
||||||
if [ "$N" -ge 11 ]; then # Use parsed positional argument
|
if [ "$N" -gt 10 ]; then # Use parsed positional argument
|
||||||
sferr "I can only count to/from 10" # Throw an error and exit
|
sferr "I can only count to/from 10" # Throw an error and exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
counter="$N" # Use parsed positional argument
|
counter="$N" # Use parsed positional argument
|
||||||
echo -n "$sftbf" # Print everyting from here bold
|
echo -n "$sftbf" # Print everyting from here bold
|
||||||
while [ "$counter" -ge 1 ]; do
|
while [ "$counter" -gt 0 ]; do
|
||||||
if [ "$reverse" == true ]; then # Use parsed flag
|
if [ "$reverse" == true ]; then # Use parsed flag
|
||||||
echo " $counter"
|
echo " $counter"
|
||||||
else
|
else
|
||||||
|
|
@ -39,4 +39,4 @@ while [ "$counter" -ge 1 ]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
echo -n "$sftrs" # Reset text formatting
|
echo -n "$sftrs" # Reset text formatting
|
||||||
echo " $text" # Use parsed argument
|
echo " $text" # Use parsed argument
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue