if [ "$1" = "" ]
then
echo -n "Gib das Startkapital ein: "
read kapital
else
kapital = $1
fi
echo $kapital
When I say kapital = $1 it says that this variable does not exist:
$ sh zins.sh
zins.sh: 16: zins.sh kapital: not found
Unlike free-format languages like C, the shell is white-space sensitive in many places, and one of them is the =
in assignments. Use
kapital=$1
and it will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With