Izračun fakultete (!)
#!/bin/bash if [ $# -eq 0 ] then echo Vnesi stevilo exit fi if [ $1 -eq 1 ] then echo 1 exit else i=2 tmp=1 while true do let tmp=$i*$tmp if [ $i -eq $1 ] then echo konec: $tmp exit fi let i=$i+1 done fi
#!/bin/bash if [ $# -eq 0 ] then echo Vnesi stevilo exit fi if [ $1 -eq 1 ] then echo 1 exit else i=2 tmp=1 while true do let tmp=$i*$tmp if [ $i -eq $1 ] then echo konec: $tmp exit fi let i=$i+1 done fi