missing college code
This commit is contained in:
18
bash_scripts/cow_college.sh
Executable file
18
bash_scripts/cow_college.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
if [[ $# -ne 1 ]]; then
|
||||||
|
echo "usage: $0 <number>"
|
||||||
|
echo "please provide exactly one numeric argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [[ "$1" =~ ^[0-9]+$ ]] || (("$1" < 1)); then
|
||||||
|
echo "error: argument must be a positive integer"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
reset
|
||||||
|
for ((i = 2; i < "$(($1 + 1))"; i++)); do
|
||||||
|
cowsay "$((($i - 1) * ($i - 1)))"
|
||||||
|
sleep 1
|
||||||
|
clear
|
||||||
|
done
|
||||||
|
cowsay -e oo -T U "$(($1 * $1))"
|
||||||
Reference in New Issue
Block a user