# Brush 0.5, the bash written in Rust, put to the test: the 96% is about completion tests, not bash

- **Published on:** 2026-11-27
- **Category:** News
- **Original page:** https://free-linux.com/articles/brush-0-5-bash-in-rust-tested

Brush 0.5 runs many more bash scripts unchanged and ships its first Windows binaries. We installed it on Debian 13 and compared it with bash: it gets 12 of our 15 scripts right, matches bash's output in 13 of the 86 scripts in bash's own test suite, and starts and computes more slowly. What the 96% figure in the headlines really means.

---

**Brush** is a bash- and POSIX-compatible shell written in Rust. On 26 November 2026 it released version **0.5.0**, after six months of work, more than 360 merged pull requests and 401 commits since 0.4. Reuben Olinsky started the project in 2024. It is MIT-licensed and has around 2,300 stars on GitHub.

The figure doing the rounds these days is that Brush "passes more than 96% of the tests". It deserves a careful read. That 96% does not refer to bash's test suite but to the suite of [**bash-completion**](https://github.com/scop/bash-completion), the package that provides tab completion for `git`, `apt`, `systemctl` and friends: 2,040 passing tests, measured in the project's CI and excluding skipped ones. It is an achievement, but a different one. Against bash's own regression suite, our numbers are far more modest.

## What Brush 0.5 brings

According to the [release notes](https://github.com/reubeno/brush/releases/tag/brush-shell-v0.5.0), these are the most visible changes:

- **More bash scripts run unchanged.** At least 144 commits go straight to compatibility. Pipelines with functions and command groups no longer hang when the writer fills the buffer before the reader starts. An `exit` inside a pipeline stage stays in that stage. Here-documents inside `$( )` no longer confuse the parser, and `read` understands multibyte UTF-8.
- **More tests against bash.** Its suite that uses bash as an "oracle" grows from about 2,100 cases to more than 3,600. End-to-end tests with real tools are added: `fzf`, `atuin`, `starship`, `zoxide`, `mise`, `nvm` and `oh-my-git`.
- **Tools that now work.** Gentoo ebuilds can use `local -I`, and `mise activate bash` no longer trips over `export -a`.
- **Interactive use.** Syntax highlighting adapts to light or dark terminals, `HISTCONTROL` and `HISTFILE` are honoured, and `bind -x` no longer kills the shell.
- **Installer and Windows.** There is an `install.sh` for Linux and macOS that detects glibc or musl and checks the SHA-256, the first Windows x64 and ARM64 binaries, and an [in-browser playground](https://play.brush.sh) compiled to WebAssembly.

Anyone using it as a library gets API changes, with per-version migration guides. Building `brush` requires Rust 1.95.

## We tested it

We installed the official aarch64 binary in a `debian:13` container, checked its SHA-256 sum and compared it with the bash 5.2.37 that ships with Debian. We ran three tests.

**Fifteen scripts of our own** covering what actually shows up in everyday scripts: indexed and associative arrays, parameter expansion, arithmetic, here-docs, `pipefail`, process substitution, `mapfile`, recursive functions, `trap`, regular expressions with `BASH_REMATCH`, `printf`, `read`, `getopts`, `set -euo pipefail`, background jobs and `coproc`. We compared each shell's output and exit code. **Twelve of fifteen come out identical.** The three that fail are bugs that can break a real script:

| Script | bash | Brush 0.5 |
|---|---|---|
| `trap '…$LINENO' ERR` | Reports the line of the failing command (3 and 4) | Reports the line where the `trap` was defined (2) both times |
| `( exit 4 ) & wait $!` | `wait` returns 4 | `wait` returns 0 |
| `local -n ref=$1; ref=…` | The caller's variable changes | The variable does not change: namerefs don't work |

The last two are documented. The project's [compatibility table](https://github.com/reubeno/brush/blob/brush-shell-v0.5.0/docs/reference/compatibility.md) warns that `$!` does not "reliably" provide the PID of the last background job, and that namerefs are the largest group of known failures in its suite. The `wait` one is particularly nasty: a script that runs jobs in parallel and then checks them with `wait $!` will think everything went fine even when they failed.

**Real system scripts.** `ldd`, which on Debian is a bash script, lists exactly the same libraries under Brush as under bash. Loading Debian's `bash_completion` registers the same 122 completions in both, and the `apt` one loads on demand in the same way.

**bash 5.3's regression suite.** We built bash 5.3 from the official source and ran its 86 test scripts (`tests/run-*`) with both bash and Brush, comparing what each one prints. **Brush prints exactly the same as bash in 13 of the 86**, hangs until the 30-second limit kills it in 3 (`getopts`, `jobs` and `varenv`) and differs in the rest. Read it with care: each script covers a whole area (arrays, quoting, `printf`…) and a single different line is enough for a mismatch. The furthest off are, again, `nameref` and `ifs-posix`. It matches what the project itself publishes: its [expected-failure list](https://github.com/reubeno/brush/blob/brush-shell-v0.5.0/e2e/bash-tests/xfail-list.txt) marks 75 of those scripts.

## Slower and hungrier, for now

<figure>
  <img src="/articles/brush-0-5-bash-rust/brush-0-5-bash-rust-prueba.webp" alt="Terminal in a Debian 13 arm64 container. The SHA-256 sum of the brush 0.5.0 binary checks out. Fifteen test scripts give the same output in bash 5.2.37 and brush in twelve cases; the differences are the ERR trap, which in brush reports line 2 instead of 3 and 4, wait on a background process, which returns 0 instead of 4, and the local -n reference, which does not change the variable. hyperfine measures 0.6 ms to start bash and 1.6 ms for brush, and 0.70 s against 1.20 s on a 200,000-iteration loop. Peak memory is 2852 KB with bash and 6116 KB with brush. The bash 5.3 regression suite gives 13 identical scripts and 3 hangs out of 86" loading="lazy" decoding="async">
  <figcaption>Brush 0.5.0 against bash on Debian 13: twelve of fifteen scripts identical, slower startup and loop, and the bash 5.3 suite summary · Own screenshot</figcaption>
</figure>


Brush does not claim to be fast, but it is the first question anyone asks about something written in Rust. In the same container, with `hyperfine`:

| Measurement | bash 5.2.37 | Brush 0.5.0 |
|---|---|---|
| Start and exit (`-c true`) | 0.4-0.6 ms | 1.6 ms |
| 200,000-iteration loop with arithmetic and a function call | 0.70 s | 1.20 s |
| Peak memory at startup (RSS) | 2.9 MB | 6.1 MB |
| Binary size | 1.4 MB | 6.9 MB |

In our test Brush takes three to four times longer to start, 70% longer on the loop and uses twice the memory. In an interactive session you won't notice. In a `Makefile` or a build system that spawns thousands of shells, you will. The project says it cut copies and allocations in this release. Even so, Brush is not about beating bash on speed but about offering a modern shell that can also be embedded in other programs as a library.

## Is it worth it?

To try it as an interactive shell, yes. It loads `bash-completion`, `starship` or `zoxide`, has syntax highlighting out of the box, and installs with a single command or runs in the browser with nothing to install. To run production scripts, not yet. Things used every day fail, such as `wait $!` and namerefs, and the project says so in its own documentation.

It is part of the same trend that has Ubuntu shipping `sudo-rs` and uutils coreutils, and that we covered in the [state of Rust in the kernel](/articles/rust-linux-kernel-inside-unsafe-drivers). If you write bash scripts, our piece on [`noclobber`](/articles/noclobber-bash-stop-redirect-overwriting-files) is worth a read too, and Brush honours it just like bash.

## How we tested this

On 26 November 2026, in a `debian:13` arm64 container (Apple M2 Max, 12 cores for Docker), with the official `brush-aarch64-unknown-linux-gnu` 0.5.0 binary (git `c10a423`) and Debian's bash 5.2.37. For the bash suite we built bash 5.3 from the official GNU tarball. Times are `hyperfine` means (300 runs for startup, 5 for the loop) and vary a little between rounds because the machine was busy with other work. The test scripts can be [downloaded](/articles/brush-0-5-bash-rust/brush-pruebas.tar.gz) (comments in Spanish).

```bash
docker run --rm -it -v "$PWD/brush-pruebas:/t" debian:13 bash
apt update && apt install -y curl ca-certificates hyperfine time diffutils bash-completion build-essential
cd /tmp
V=brush-shell-v0.5.0; A=brush-aarch64-unknown-linux-gnu   # on x86-64: brush-x86_64-unknown-linux-gnu
curl -fsSLO https://github.com/reubeno/brush/releases/download/$V/$A.tar.gz
curl -fsSLO https://github.com/reubeno/brush/releases/download/$V/$A.sha256
sha256sum -c $A.sha256 && tar xzf $A.tar.gz && install brush /usr/local/bin/
bash /t/run.sh                                  # 15 scripts, bash vs brush
hyperfine -N "bash -c true" "brush -c true"
hyperfine "bash /t/bucle.sh" "brush /t/bucle.sh"
# bash 5.3 suite (takes a few minutes):
curl -fsSLO https://ftp.gnu.org/gnu/bash/bash-5.3.tar.gz && tar xzf bash-5.3.tar.gz
(cd bash-5.3 && ./configure -q && make -s -j"$(nproc)" && make -s recho zecho printenv xcase && cp recho zecho printenv xcase tests/)
sh /t/suite.sh
```

## Sources

- Brush, [0.5.0 release notes](https://github.com/reubeno/brush/releases/tag/brush-shell-v0.5.0), GitHub, 26 Nov 2026.
- Brush, [bash compatibility reference](https://github.com/reubeno/brush/blob/brush-shell-v0.5.0/docs/reference/compatibility.md) and [expected-failure list for the bash suite](https://github.com/reubeno/brush/blob/brush-shell-v0.5.0/e2e/bash-tests/xfail-list.txt).
- [scop/bash-completion](https://github.com/scop/bash-completion), completion test suite.
- GNU, [bash 5.3](https://ftp.gnu.org/gnu/bash/) and its [reference manual](https://www.gnu.org/software/bash/manual/).
