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)
LLM (this repo) · 1

Related languages

YSH (0.41)Bourne Shell (0.23)C Shell (0.21)Zsh (0.21)Scsh (0.21)

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
code.osh · license: Apache-2.0 · added: 2026-02-26T00:00:00Z
#!/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

Contribute — propose a file extension

Tell us where to find evidence about Oil Shell (mapped to pl/oil_shell). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Oil Shell/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Oil OISC:2 →