Adding upstream version 5.2.37.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
parent
cf91100bce
commit
fa1b3d3922
1435 changed files with 757174 additions and 0 deletions
13
examples/functions/fact
Normal file
13
examples/functions/fact
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Who said shells can't use recursion? Here is a factorial function.
|
||||
# You call it with a number as an argument, and it returns the factorial
|
||||
# of that number.
|
||||
|
||||
fact ()
|
||||
{
|
||||
local num=$1;
|
||||
if [ "$num" = 1 ] ; then
|
||||
echo 1
|
||||
return ;
|
||||
fi;
|
||||
echo $(( $num * $(fact $(( $num - 1 )) ) ))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue