Here I want to use the value given by the user it is stored in variable n and I want to use it in my recursive function to make a loop
My code
echo "Enter the Number to find the Factorial"
read n
fact = 1;
function factorial(n) {
if [ $n -eq 0 ]; then
echo $fact
else
fact=$(($fact * $n))
factorial $(($n - 1))
fi
}
This is the error which is shown syntax error near unexpected token `x'