https://github.com/oils-for-unix/oils/wiki/The-Biggest-Shell-Programs-in-the-World Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners + Executive Insights * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} oils-for-unix / oils Public * * Notifications You must be signed in to change notification settings * Fork 160 * Star 2.9k * Code * Issues 499 * Pull requests 23 * Actions * Projects 0 * Wiki * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights The Biggest Shell Programs in the World Jump to bottom Edit New page David Anderson edited this page Dec 7, 2024 * 52 revisions Help me fill out this page! It's freely editable. What programs should be listed? I'm using "biggest" in the sense of substantial, not necessarily the raw number of lines. * Hand-written shell scripts. There are many big autoconf-generated scripts, like the 70K-line coreutils script, but I don't consider them substantial in this sense. * Shell programs that use data structures and algorithms. + As a counterexample, bash-completion is pretty sophisticated, but it's also repetitive because it has a relatively simple function for every command on a Unix machine. * Shell programs that are over 5K lines (though there may be exceptions). The biggest shell programs that aren't repetitive tend to be in the 10K+ line range. I haven't seen any programs over 100K lines. The List * akinomyoga/ble.sh -- 61K LoC (46K SLoC) in total. Bash Line Editor---fish-like interactive line editor in pure bash! The main file out/ble.sh has 30K lines of code (23K SLoC), but there are 60K+ lines of code in the repo in total. There are many comments (in Japanese). + How Interactive Shells Work has a nice overview of how ble.sh works. It's very sophisticated, using bind -x to read raw bytes from the terminal, decoding those itself in mulitiple explicit state machines, maintaining a drawing buffer, updating the buffer, etc. It has timing and "fibers", etc. + This comment on issue 663 has details on the shell parser! I think this is one of the most sophisticated uses of data structures in shell I've seen. + We are trying to run ble.sh under OSH. It mostly parses. + First commit in 2015 with 8K LoC / 6 SLoC. The actual development has started in 2013. * kalua - OpenWRT addon ~56K SLoC/lines of POSIX shell * bashdb, the bash debugger. ~14K lines of bash. Interesting history: Implementing Debuggers * drwetter/testssl.sh -- 21K lines of bash in a single file! Appears to be hand-written. History: Back in 2006 it started with a few openssl commands.... (Hit issue #606 parsing it.) * Simplenetes: Kubernetes in 17K lines of Shell. Amazing! But seems dormant. Hacker News Thread. + Related to my bold claim here * rkhunter (official site) -- 21K lines of Bourne shell written from 2003-2018! * romkatv/powerlevel10k -- 12K lines of zsh scripts in the directory internal/. There are other 8K lines of configs and helper scripts. First commit in 2014. * dylanaraps/neofetch -- 10K lines of bash 3.2. Displays system information. May also do something interesting with images (?) + first commit 2015 * xwmx/nb -- 24K LoC (19K SLoC) of bash in nb itself. An additional 86K LoC (55K SLoC) if we count bats tests as bash. + First commit in 2014, but active commit history starts in early 2016. * distrobox -- over 7k lines of bash script. Use any linux distribution inside your terminal. * acme.sh -- 7K lines of shell script. Issues and renews certificates. * inxi 2.3.56 [obsolete] -- 16K lines of bash. A fork of infobash in 2008 (889 lines then). infobash has started in 2005. From v2.9, inxi is replaced by the Perl implementation. * bashforth -- At ~3800 lines this isn't huge, but it apparently implements a real programming language. It has a lot of whitespace and comments. * yoda -- While only about half the size of the above bashforth, this again is an implementation of a whole interpreter and compiler, while being considerably more feature-packed. Same author, but a 20 years younger implementation. Comment: "What learned you have, unlearn you must!" * vegardit/bash-funk -- 27K LoC (24K SLoC) in total. A Bash library. The first commit in May, 2017 (with 10K LoC / 8K SLoC). * Relax-and-Recover -- 35K LoC (24K SLoC). Backup and restoration tool. First git commit March, 2009 (with 4K LoC / 3K SLoC) * abcde / A Better CD Encoder, used for ripping CDs, weighs in at around 5.5k LoC. * thc-segfault -- 3.3K LoC. A pubnix server built mostly using Bash * ffmpeg/configure - 8.4K LoC. FFmpeg's configure script is hand-written * ffhevc -- 4k LoC. Fully hand-written Bash wrapper script for encoding to HEVC video using FFmpeg and libx265. * ffx264 -- 3.9k LoC. Fully hand-written Bash wrapper script for encoding to H.264/AVC video using FFmpeg and libx264. * h264enc -- 9.2k LoC. Fully hand-written Bash wrapper script for MEncoder for encoding to H.264/AVC video. * bashtop -- 5.3k LoC. A resource monitor * halcyon -- 6.6k LoC. A system for installing Haskell apps; hand-written with careful attention to bash semantics and error-checking, in a peculiar style inspired by functional programming. * winetricks -- 22K lines of shell script. Installs various Windows programs under Wine * wordshell -- ~7k lines of code. Manages multiple WordPress sites from the command-line. Shell-Like Languages / DSLs * modernish is a portable shell dialect written in shell * bats is a DSL for writing tests. Generates bash code. * bashible is an Ansible-like DSL in bash. comments * clash is an object oriented framework compatible with any modern POSIX shell. * bash Infinity is a standard library and a boilerplate framework for bash. Smaller Programs * Alpine, Aboriginal, Debian scripts -- see blog post * Completion scripts are big, but often repetitive. + _git Zsh completion -- 8.3k lines of code + git-completion.bash + Docker completion * dyne/Tomb is a ~3500 line zsh script. * Basalt -- a full-featured package manager in pure Bash (est. ~2021). Although it's only a few thousand lines, there's already a rich ecosystem (15+ apps/libs) that includes many thousand more lines. Some Bash libraries include (at various stages of development): + bash-core, a library for enhancing the trap and shopt builtins, adding stacktraces, and many essential amenities + bash-object, a library for constructing arbitrarily nested data structures in pure Bash (nearly 200 tests) + bash-json, a library for parsing and printing JSON in pure Bash * tablespoon/fun/cli-clock - a clock with multiline characters written in bash. * json.bash / jb -- a command-line tool and bash library that creates JSON (~1700 lines, plus ~3000 lines of tests). Links * OSH "Wild" Tests parse over a million lines of shell. However most of these are small programs and distro package definitions like Alpine PKGBUILD and Gentoo ebuilds, which are repetitive. * Shell Programs That Run Under OSH * shell script are dangerous The shell is a program to handle your system internally via an interactive console(or not)... It's feature full and extremely dangerous. it's not done to produce applications. Add a custom footer Toggle table of contents Pages 137 [ ] * Loading Home * Loading Ad Hoc Protocols in Unix * Loading Alternative Regex Syntax * Loading Alternative Shells * Loading Architecture of Various Interpreters * Loading Autocompletion Use Cases * Loading BootstrappingCaseStudies * Loading Can Oil Use Nix? * Loading Capers * Loading Carrots * Loading CLAP Grammar Proposal * Loading Command vs Expression Mode * Loading Compact AST Representation * Loading Compiler Engineer Job * Loading Compiler Engineer Notes * Loading Completion Chat November 2019 * Loading Composable Distributed OS * Loading Config Dialect * Loading Contributing * Loading Coprocess Language Support * Loading Coprocess Protocol Proposal * Loading Coprocess Protocol V2 * Loading CSTR Proposal * Loading Debugging Completion Scripts * Loading Developing Oil With Nix * Loading Difficulties With Unix Signals * Loading Distributed Shell * Loading Diversity in Command Line Syntax * Loading Documentation Strategy * Loading each Keyword in Oil * Loading Exhaustive Test Suite * Loading Explicit Framing Protocol Proposal * Loading ExternalResources * Loading FAQ: Why Not Write Oil in X? * Loading Feature Detection Is Better than Version Detection * Loading Fish Oil Brainstorming * Loading Flag Parsers in Various Languages * Loading GitTips * Loading Gradually Upgrading Shell to Oil * Loading Gradually Upgrading Shell to YSH * Loading Hay * Loading Headless Mode * Loading How Interactive Shells Work * Loading How Terminals Work * Loading How To Test OSH * Loading Implementations of Shell Autocompletion * Loading Implementer Lore About Garbage Collection * Loading Implementing Debuggers * Loading Implementing the Oil Expression Language * Loading Interactive Shell * Loading Internal DSLs for Shell * Loading Language Composition Bestiary * Loading Language Data Models * Loading Language Design and Theory of Computation * Loading Language Design Principles * Loading Language Subsets * Loading Little Languages * Loading Lossless Syntax Tree Pattern * Loading M by N Code Explosions * Loading Making Pull Requests * Loading Metaprogramming * Loading Metaprogramming Use Cases * Loading Migration Guide * Loading Oil and the R Language * Loading Oil Blog Planning * Loading Oil Deployments * Loading Oil Dev Cheat Sheet * Loading Oil Dev Tips * Loading Oil Language Docs * Loading Oil Language FAQ * Loading Oil Native Quick Start * Loading Oil Ninja Build * Loading Oil Parser Generator Project * Loading Oil Windows Port * Loading Oils Deployments * Loading Oils Packaging Guidelines * Loading Oilshell Usage (The table missing in getting started.md) * Loading OSH Builtins: "Hello, world!" Example * Loading OSH Compatibility Tips * Loading OSH Optimization Log * Loading OSH Parser * Loading OSH versus Oil * Loading OSH Word Evaluation Algorithm * Loading Parsing is Difficult * Loading Parsing Models Cheatsheet * Loading Parsing Shell Quotes Requires Parsing the Whole Language * Loading ParsingCaseStudies * Loading Partial Evaluation * Loading Patterns and Anti Patterns * Loading Perlis Thompson Principle * Loading Polyglot Language Understanding * Loading Project Goals * Loading Projects Already Doing Something Like Shellac * Loading Python App Bundle * Loading QSN * Loading QTT * Loading Recent Dev Friction * Loading Recommended Reading * Loading Running ble.sh With Oil * Loading Running Oils as build shell * Loading SHCOMP Protocol Proposal * Loading Shell Almost Has a JSON Analogue * Loading Shell Autocompletion * Loading Shell Programs That Run Under OSH * Loading Shell Security Problems * Loading Shell WTFs * Loading Shellac Protocol Proposal * Loading Shellac Protocol Proposal V2 * Loading Shellac Test Cases * Loading Signal Handling in Oil * Loading Slogans, Fallacies, and Concepts * Loading Soil * Loading Spec Tests * Loading Startup Time Measurements * Loading Structured Data in Oil * Loading Structured Data Over Pipes * Loading Survey of Config Languages * Loading Task Under NLNet Grant * Loading Tasks Under NLNet Grant * Loading Technical Writing * Loading Testing the Interactive Shell * Loading The Biggest Shell Programs in the World + The List + Shell-Like Languages / DSLs + Smaller Programs + Links * Loading Tips on Using pgen2 * Loading Toil * Loading Travis CI for Oil * Loading TSV2 * Loading TSV2 Proposal * Loading Unifying Make and Shell * Loading Unix Tools * Loading Using OSH as a Default Shell * Loading Using Zephyr ASDL * Loading Ways To Get Feedback Prioritized * Loading What Is Expected to Run Under OSH * Loading Where Contributors Have Problems * Loading Where To Send Feedback * Loading Why Lexing and Parsing Should Be Separate * Loading Why Use Oil? * Show 122 more pages... Add a custom sidebar Clone this wiki locally [https://github.com/o] Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.