mirror of
https://github.com/sigmasternchen/fibonacci
synced 2025-03-15 16:18:59 +00:00
16 lines
199 B
Bash
Executable file
16 lines
199 B
Bash
Executable file
#!/bin/sh
|
|
|
|
fibonacci() {
|
|
i="$1"
|
|
if test "$i" = 0; then
|
|
cat
|
|
return 0
|
|
fi
|
|
|
|
(tee /dev/stderr | tail -n 2 | awk '{s += $1} END {print s}') 2>&1 | fibonacci $((i - 1))
|
|
}
|
|
|
|
fibonacci 5 <<EOF
|
|
1
|
|
1
|
|
EOF
|