explaingit

dotike/fsh

Analysis updated 2026-05-18

33CAudience · developerComplexity · 2/5LicenseSetup · moderate

TLDR

A port of FreeBSD's sh shell to macOS, useful for scripts that need predictable echo behavior that zsh does not provide.

Mindmap

mindmap
  root((fsh))
    What it does
      Ports FreeBSD sh
      Predictable echo
    Tech stack
      C
      libedit
      macOS
    Use cases
      Portable scripting
      Shell comparison
    Audience
      Mac developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run scripts on macOS that need FreeBSD sh's predictable, non-interpreting echo behavior.

USE CASE 2

Test how a script behaves differently under zsh versus a Bourne-lineage shell.

USE CASE 3

Build fsh from source using Xcode Command Line Tools and Homebrew.

USE CASE 4

Use fsh as a portable reference shell for cross-system script development.

What is it built with?

ClibeditmacOS

How does it compare?

dotike/fshdreamfekk/andriod-autouedump-guiopensourcerer-dev/ps5debug-ng
Stars333531
LanguageCCC
Setup difficultymoderatehardhard
Complexity2/55/55/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

No package installer yet, building from source with Xcode Command Line Tools is required.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice and do not use the author's name to promote derived products.

In plain English

This project ports FreeBSD's sh shell to macOS, giving Mac users access to a Bourne-lineage shell that behaves differently from the zsh shell Apple ships by default. The main reason someone would reach for it is a specific difference in how the two shells handle the echo command. On macOS, zsh's built-in echo interprets escape characters like \n (newline) and \t (tab) automatically. That means typing echo "hello\nworld" in zsh actually prints two lines. FreeBSD sh does not do this. Its echo prints exactly what you give it, and escape interpretation only happens if you explicitly ask for it with a flag. This matters for scripts that need to produce consistent, predictable output across different systems and shells. The project takes the shell source from a February 2023 snapshot of the FreeBSD codebase and adds a small compatibility layer to make it compile on macOS. It links against libedit, a library that provides line editing, command history, and tab completion in the terminal. The resulting binary is called fsh and installs to ~/bin by default. Building it requires Xcode Command Line Tools and Homebrew, which are standard tools for developers on Mac. The README includes a short demonstration showing the difference in echo behavior between fsh and zsh side by side. The license is BSD-2-Clause, the same permissive license FreeBSD itself uses. The README is short and focused. It covers the motivation, build steps, a quick test, and the source origin. There is no package installer available yet (the Homebrew tap section is commented out in the source), so building from source is the only install path at the moment.

Copy-paste prompts

Prompt 1
Walk me through building and installing fsh from source on macOS.
Prompt 2
Explain the difference in echo behavior between fsh and zsh with an example.
Prompt 3
Show me how fsh's compatibility layer adapts FreeBSD's shell source to compile on macOS.
Prompt 4
Help me decide whether fsh or zsh is the right shell for a script I'm writing.

Frequently asked questions

What is fsh?

A port of FreeBSD's sh shell to macOS, useful for scripts that need predictable echo behavior that zsh does not provide.

What language is fsh written in?

Mainly C. The stack also includes C, libedit, macOS.

What license does fsh use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice and do not use the author's name to promote derived products.

How hard is fsh to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is fsh for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.