A bash-compatible shell written in Rust.

huck implements most of bash's surface — expansions, control flow, functions, arrays, job control, line editing, completion — and verifies it byte-for-byte against real bash.

huck
$ huck
huck> for f in *.rs; do echo "${f%.rs}"; done
huck> name=(alice bob); echo "${name[@]^}"
Alice Bob
huck> diff <(huck -c 'echo ${x:-hi}') <(bash -c 'echo ${x:-hi}') && echo identical
identical

Byte-identical, bash-diff verified

Every feature ships with a bash-diff harness that runs the same fragment through both shells and asserts identical output — not just "looks right".

Near-bash speed

Command-substitution-heavy scripts run at near-bash speed: each $() Shell clone is O(1) via copy-on-write, so nvm-heavy startup files stay fast.

Sources a real ~/.bashrc

huck loads bash-completion, a git prompt, nvm, and mise activation without errors, and drives interactive tab completion against the system bash-completion package.

What huck supports

Expansions

Parameter expansion with the full modifier set (${v:-w}, ${v/p/r}, ${v^^}, ${v@Q}), arithmetic $((…)), command substitution $(…) / `…`, brace expansion, tilde, and pathname globbing including extglob.

Control flow & functions

if/elif/else, while/until, for (word-list, C-style, "$@"), select, and case, plus functions in name() or function name form with local scoping and the [[ … ]] extended test.

Variables & arrays

Scalars, indexed arrays, and associative arrays (declare -A), with integer, readonly, and export attributes, declare -g, and printf -v.

Job control

Foreground and background process groups with terminal handoff, so vim, less, and Ctrl-Z all work, plus jobs/fg/bg/wait/kill/disown with the full %N job-spec syntax.

Line editing, history & completion

A line editor with persisted history, bash-style history expansion (!!, !$, …), and programmable tab completion that drives the system bash-completion framework.

Builtins & options

cd, printf, read, test/[, [[, export, declare/typeset, set (-e/-u/-x/-o pipefail/…), shopt, trap, alias, and the rest of the builtins real scripts depend on.

See the full breakdown, with examples for every group, on the features page.

Real arrays, real arithmetic

nums=(3 1 4 1 5 9)
total=0
for n in "${nums[@]}"; do
  (( total += n ))
done
echo "sum: $total"