factorial ()
{
if (( $1 <= 1))
then
return 1
else
typeset tmp
typeset result
(( tmp = $1 - 1 ))
factorial $tmp
(( result = $? * $1
return $result
fi
}
factorial 5
echo factorial 5=$?
소스는 이거구여~ 당체 이해가 안되네여 콘셸(Korn shell) 입니다.
주석이나 제가 이해 할수 있게 해주실분 있나여?