ed(1) on Solnix vs Linux and the BSDs
On Solnix, ed is the illumos ed at /usr/bin/ed. It takes -s (or the older -), -p string, -x and -C. Unlike GNU ed it has no long options, -E, -G or +line, and unlike NetBSD it has no -E or -S.
The manual pages
- Solnix: ed(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: ed(1) ed-1.22.5
- FreeBSD: ed(1) 15.1-RELEASE
- OpenBSD: ed(1) 8.0
- NetBSD: ed(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
ed
What Solnix runs
/usr/bin/ed is the illumos ed. /usr/xpg4/bin/ed and /usr/xpg6/bin/ed are also shipped with the same synopsis. The one difference the bundle documents is that only /usr/xpg6/bin/ed lets either address be omitted around a comma or semicolon (for example ',' means 1,$). /usr/bin/red is a restricted version.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | long options and extra flags | GNU ed accepts long options and flags such as -E, -G, -l, -q, -r, -v, --strip-trailing-cr and --unsafe-names. The Solnix synopsis lists only -s, -, -p, -x and -C, so scripts that use the GNU flags fail on Solnix.Source: Linux ed(1) OPTIONS; Solnix ed(1) SYNOPSIS |
| Linux | quiet flag | Solnix ed -s (or -) is the only quiet option the synopsis shows. GNU ed has -s/--script, which suppresses byte counts and the '!' prompt, and a separate -q/--quiet, which suppresses diagnostics on stderr. The Solnix text shown here does not describe what -s suppresses.Source: Linux ed(1) -s, -q; Solnix ed(1) SYNOPSIS |
| FreeBSD, OpenBSD, NetBSD | -s meaning | On FreeBSD, OpenBSD and NetBSD, -s suppresses diagnostics and is meant for scripted input. OpenBSD and NetBSD also accept - as a deprecated synonym. The Solnix synopsis shows -s and - as alternatives, but the trimmed Solnix text does not define either.Source: FreeBSD ed(1) -s; OpenBSD ed(1) -, -s; NetBSD ed(1) -, -s; Solnix ed(1) SYNOPSIS |
| Linux, NetBSD | extended regular expressions | GNU ed and NetBSD ed have -E for extended regular expressions. Solnix has no -E: the page says Internationalized Basic Regular Expressions are used for all system-supplied locales.Source: Linux ed(1) -E; NetBSD ed(1) -E; Solnix ed(1) Regular Expressions |
| NetBSD | -S and -x | NetBSD -S disables the ! command, for batch jobs such as patch(1). Solnix has no -S. Both Solnix and NetBSD have -x, which the NetBSD page describes as prompting for an encryption key. Solnix also has -C, which NetBSD lacks.Source: NetBSD ed(1) -S, -x; Solnix ed(1) SYNOPSIS |
| FreeBSD, OpenBSD | -x not available | FreeBSD and OpenBSD ed list only -s and -p (OpenBSD also lists -). They have no -x or -C, which the Solnix synopsis accepts.Source: FreeBSD ed(1) SYNOPSIS; OpenBSD ed(1) SYNOPSIS; Solnix ed(1) SYNOPSIS |
| Linux | +line argument | GNU ed accepts +line, +/RE or +?RE before the file name to set the starting line. The Solnix synopsis takes only an optional file. Source: Linux ed(1) DESCRIPTION, SYNOPSIS; Solnix ed(1) SYNOPSIS |
| all four | restricted mode | Solnix red only allows editing files in the current directory and refuses !shell command. GNU ed documents red as the same. The FreeBSD page says it restricts names starting with '!' or containing '/'. It adds that symlinks in a writable current directory can get around this. Source: Solnix ed(1) DESCRIPTION (red); Linux ed(1) DESCRIPTION; FreeBSD ed(1) DESCRIPTION |
| FreeBSD | multibyte characters | The FreeBSD page says ed does not recognize multibyte characters. The Solnix text in the bundle says only that Internationalized Basic Regular Expressions are used for system-supplied locales. Source: FreeBSD ed(1) BUGS; Solnix ed(1) Regular Expressions |
| Linux | exit status | GNU ed documents exit codes 0 to 3 and has -l to exit 0 even when a command fails. The Solnix text in the bundle has no exit status section, so the manual does not say what exit codes ed returns.Source: Linux ed(1) EXIT STATUS, -l; Solnix ed(1) (no EXIT STATUS in bundle) |
| OpenBSD, NetBSD | initial current line and unsaved-buffer warning | OpenBSD and NetBSD set the current address to the last line when a file is first read. On Solnix, ed prints "?" when e or q would discard unsaved changes, and repeating the command takes effect. The BSD pages shown here do not describe this. Source: OpenBSD ed(1) LINE ADDRESSING; NetBSD ed(1) LINE ADDRESSING; Solnix ed(1) DESCRIPTION |
Standards
- POSIX: ed is a POSIX.1-2024 utility.
Writing portable scripts
- In scripts, use only ed
-sfile (or ed-pstring) with commands fed on standard input. Avoid-E,-G,-l,-q,-S,-xand-C, which exist on only some systems. - Do not rely on the shell exit code of ed. The manuals disagree on what is documented, and only GNU ed documents its exit codes.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.