Linux-Workshop
Shell Scripting im Admin-Alltag
Rechnen in und mit der Bash
Bekannt sein dürfte der Klassiker "expr", der über viele Plattformen Kompatibilität bringt:
count=10
while [ $count -gt 0 ]; do
echo $count
count=$(expr $count - 1)
done
Alternativen aus der Bash:
• let count=$count-1
• count=$((count-1))
• count=$[count-1]