echo(1b) on Solnix vs Linux and the BSDs
The page describes /usr/ucb/echo, the BSD-style echo, which has only -n and does not interpret backslash escapes. A default Solnix system runs /usr/bin/echo, which per the page interprets backslash escapes and has no -n option, so it differs from every counterpart.
The manual pages
- Solnix: echo(1b) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: echo(1) coreutils-full-9.11
- FreeBSD: echo(1) 15.1-RELEASE
- OpenBSD: echo(1) 8.0
- NetBSD: echo(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
echo
What Solnix runs
The page is published for /usr/ucb/echo, but a default Solnix system has the illumos /usr/bin/echo on PATH. Per this page, /usr/bin/echo understands backslash escapes and has no -n option, while /usr/ucb/echo has -n and no escapes. The csh, ksh and sh built-in echo takes precedence when you type echo without a full path. The page lists no escape sequences for /usr/bin/echo, only \a for the ksh built-in.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| all four | -n on the default /usr/bin/echo | The Solnix page says /usr/bin/echo, sh's echo and ksh's echo do not have -n. Only /usr/ucb/echo and csh's echo do. Linux, FreeBSD, OpenBSD and NetBSD echo all document -n. A script running echo -n by full path may not suppress the newline on Solnix.Source: Solnix echo(1b) DESCRIPTION (last paragraph), OPTIONS -n; Linux echo(1) -n; FreeBSD echo(1) -n; OpenBSD echo(1) -n; NetBSD echo(1) -n |
| Linux, OpenBSD | backslash escapes by default | Solnix /usr/bin/echo understands backslash escapes with no option. /usr/ucb/echo does not. On Linux and OpenBSD, escapes are off by default (-E) and enabled only with -e.Source: Solnix echo(1b) DESCRIPTION (last paragraph); Linux echo(1) -e, -E; OpenBSD echo(1) -E, -e |
| Linux, OpenBSD | -e and -E | The Solnix page documents neither -e nor -E; its only option is -n. Linux and OpenBSD echo have both. Scripts using echo -e will not get the effect they expect from the Solnix /usr/ucb/echo.Source: Solnix echo(1b) SYNOPSIS, OPTIONS; Linux echo(1) -e, -E; OpenBSD echo(1) SYNOPSIS, -e, -E |
| FreeBSD, NetBSD | same option set, different escape handling | FreeBSD and NetBSD echo have only -n, as /usr/ucb/echo does. FreeBSD also suppresses the newline when the string ends in \c, and its page says -n and \c are implementation-defined. The Solnix page says /usr/ucb/echo does not understand backslash escapes.Source: FreeBSD echo(1) DESCRIPTION; NetBSD echo(1) SYNOPSIS; Solnix echo(1b) DESCRIPTION (last paragraph) |
| all four | shell built-in takes precedence | On Solnix, the csh, ksh and sh built-in echo is used unless you give a full pathname, and the built-ins differ from /usr/ucb/echo. The Linux, FreeBSD, OpenBSD and NetBSD pages also warn that shell built-ins differ from the standalone command.Source: Solnix echo(1b) DESCRIPTION; Linux echo(1) DESCRIPTION; FreeBSD echo(1) DESCRIPTION; OpenBSD echo(1) STANDARDS; NetBSD echo(1) DESCRIPTION |
| FreeBSD, OpenBSD | -- handling | FreeBSD echo does not recognise -- and writes it literally. OpenBSD echo treats -- as part of the string. The Solnix page says nothing about --. Source: FreeBSD echo(1) DESCRIPTION; OpenBSD echo(1) DESCRIPTION; Solnix echo(1b) (not documented) |
| Linux | --help and --version | Linux echo documents --help and --version as the only long options. The Solnix page documents no long options.Source: Linux echo(1) --help, --version; Solnix echo(1b) SYNOPSIS |
| FreeBSD, OpenBSD, NetBSD | exit status | FreeBSD, OpenBSD and NetBSD document exit 0 on success and >0 on error. The Solnix page has no EXIT STATUS section, so the manual does not say. Source: FreeBSD echo(1) EXIT STATUS; OpenBSD echo(1) EXIT STATUS; NetBSD echo(1) EXIT STATUS; Solnix echo(1b) |
| all four | -n is a transition aid | The Solnix page says -n is a transition aid for BSD applications and may not be supported in future releases. The other four pages document -n without such a warning.Source: Solnix echo(1b) NOTES; Linux echo(1) -n; FreeBSD echo(1) -n; OpenBSD echo(1) -n; NetBSD echo(1) -n |
Standards
- POSIX: echo is a POSIX.1-2024 utility.
- Solnix: The echo(1b) page has no STANDARDS section and states no interface stability.
- FreeBSD: The echo utility conforms to IEEE Std 1003.1-2001 (“POSIX.1”) as amended by Cor. 1-2002. The
-noption and the effect of \c are implementation-defined there. - OpenBSD: The echo utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification. The flags
-E,-eand-nconflict with the X/Open System Interfaces option, which says they should be treated as part of string. - NetBSD: The echo utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible.
Writing portable scripts
- Use printf(1) instead of echo for anything with
-n,-eor backslashes. The FreeBSD, OpenBSD, NetBSD and Linux pages all recommend it. - If you must use echo, pass a first argument that does not start with a hyphen and contains no backslashes, as the FreeBSD page advises.
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.