mirror of
https://github.com/ellysh/bash-programming-from-scratch.git
synced 2026-01-26 07:43:42 +00:00
11 lines
118 B
Bash
11 lines
118 B
Bash
#!/bin/bash
|
|
|
|
result=1
|
|
|
|
for (( i = 1; i <= $1; ++i ))
|
|
do
|
|
((result *= i))
|
|
done
|
|
|
|
echo "The factorial of $1 is $result"
|