Lisää "longcat.sh

This commit is contained in:
Nyymix 2022-04-23 20:57:14 +03:00
parent 182b00fa3a
commit b5bb9b51a1

34
longcat.sh Normal file
View file

@ -0,0 +1,34 @@
#!/bin/bash
# Tarkistetaan, että parametri on numero
if [[ $1 =~ ^[0-9]+$ ]]; then
echo ' /\___/\'
echo ' / \'
echo ' | # # |'
echo ' \ @ |'
echo ' \ _|_ /'
echo ' / \______'
echo ' / _______ ___ \'
echo ' |_____ \ \__/'
echo ' | \__/'
# kissan venytys parametrin mukaan
for (( i=0;i<$1;i++)); do
echo ' | |'
done
echo ' / \'
echo ' / ____ \'
echo ' | / \ |'
echo ' | | | |'
echo ' / | | \'
echo ' \__/ \__/'
echo ' '
# kissan pituuden kertominen
if [ $1 -gt 1 ]; then
echo ' Longcat.'
else
echo ' Shortcat.'
fi
else
echo 'Anna parametrina jokin numero esim: ./longcat.sh 1'
exit 1
fi
exit 0