I want to do a function that will return the factorial of a number in bash
Here\'s the current code that doesn\'t work, can anyone tell me what\'s wrong and how to c
Another one implementation using echo instead of return
echo
return
#!/bin/bash factorial() { if [ $1 -le 1 ] then echo 1 else echo $[ $1 * `factorial $[$1-1]` ] fi } echo "factorial $1 = " `factorial $1`