Oil Shell
1 program
Added 2026-02-26T00:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: OSH, YSH, Oils
Provenance: commit 5267a44e2e · authored 2026-02-26T13:22:14+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Fibonacci Sequence
Provenance: commit 5267a44e2e · authored 2026-02-26T13:22:14+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
#!/usr/bin/env osh
# Fibonacci sequence in Oil Shell (OSH mode)
# OSH is backward-compatible with POSIX shell and bash
fib() {
local -i n=$1
if (( n <= 1 )); then
echo $n
return
fi
local -i a=0 b=1 tmp
for (( i = 2; i <= n; i++ )); do
tmp=$(( a + b ))
a=$b
b=$tmp
done
echo $b
}
echo "First 10 Fibonacci numbers:"
for i in $(seq 0 9); do
printf " fib(%d) = %d\n" "$i" "$(fib "$i")"
done