longcat/longcat.sh

34 lines
816 B
Bash
Raw Normal View History

2022-04-23 20:57:14 +03:00
#!/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