CalcleFactorail en Bash
function factorial {
typeset n=$1
(( n < 2 )) && echo 1 && return
echo $(( n * $(factorial $((n-1))) ))
}
Courageous Copperhead
function factorial {
typeset n=$1
(( n < 2 )) && echo 1 && return
echo $(( n * $(factorial $((n-1))) ))
}
factorial () {
if (($1 == 1))
then
echo 1
return
else
echo $(( $( factorial $(($1 - 1)) ) * $1 ))
fi
}