echo(1) on Solnix vs Linux and the BSDs
On Solnix, /usr/bin/echo is the illumos echo. It takes no options and always interprets backslash escapes. Linux, OpenBSD and the other BSDs treat escapes differently: Linux and OpenBSD need -e, and the FreeBSD and NetBSD pages document only -n.
The manual pages
- Solnix: echo(1) 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
A default Solnix system runs the illumos /usr/bin/echo. /usr/ucb/echo is also shipped. The page says it has an -n option and does not understand backslash escapes. Calling echo without a path normally runs the shell builtin, not this binary. The page says sh and ksh switch their builtin to /usr/ucb/echo behaviour if that file is found first in PATH.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, OpenBSD | escape interpretation default | Solnix /usr/bin/echo always interprets backslash escapes such as \n, \t and \c. Linux and OpenBSD interpret them only with -e, and their default (-E) leaves them literal. The same script prints different output.Source: Solnix echo(1) OPERANDS; Linux echo(1) -e, -E; OpenBSD echo(1) -e, -E |
| Linux, OpenBSD | -n, -e, -E as options | Solnix /usr/bin/echo has no options. An operand of -n is written as a string, not treated as an option. Linux and OpenBSD accept -n, -e and -E. A script using echo -n or echo -e prints the flag text on Solnix.Source: Solnix echo(1) SYNOPSIS, OPERANDS ("-n" is treated as a string); Linux echo(1) -n, -e, -E; OpenBSD echo(1) SYNOPSIS |
| FreeBSD, NetBSD | -n supported elsewhere | FreeBSD and NetBSD echo accept -n to suppress the trailing newline. Solnix /usr/bin/echo treats -n as text. To suppress the newline on Solnix, end the string with \c.Source: FreeBSD echo(1) -n; NetBSD echo(1) -n; Solnix echo(1) OPERANDS (\c) |
| Linux, OpenBSD | escapes missing on Solnix | Linux and OpenBSD -e support \e (escape) and \xHH (hexadecimal byte). The Solnix escape list has neither. Solnix does list \0n for octal, using 1 to 3 digits after a zero.Source: Solnix echo(1) OPERANDS; Linux echo(1) \e, \xHH; OpenBSD echo(1) -e |
| FreeBSD, NetBSD | escape documentation | The FreeBSD page documents only \c at the end of a string. The NetBSD page lists no escapes. Neither says which other escapes the binary interprets, so do not assume the Solnix set is available. Source: FreeBSD echo(1) DESCRIPTION; NetBSD echo(1) DESCRIPTION; Solnix echo(1) OPERANDS |
| all four | builtin versus binary | On Solnix, sh, ksh, ksh93 and csh each have a builtin echo that runs by default. They differ: ksh and ksh93 have no -n, csh has -n but no escapes, and sh does not understand \a. The page says to see shell_builtins(1).Source: Solnix echo(1) DESCRIPTION; FreeBSD echo(1) DESCRIPTION; NetBSD echo(1) DESCRIPTION |
| FreeBSD, OpenBSD | -- handling | FreeBSD says -- is not recognized and is written literally. OpenBSD says -- is treated as part of string. The Solnix page does not mention --, though it takes no options. Source: FreeBSD echo(1) DESCRIPTION; OpenBSD echo(1) DESCRIPTION; Solnix echo(1) SYNOPSIS |
| Linux, OpenBSD | \c scope | On Solnix, \c ignores all following characters in that argument, and the page does not say whether later arguments are printed. On Linux it produces no further output. On OpenBSD it suppresses further output, including the newline. Source: Solnix echo(1) OPERANDS (\c); Linux echo(1) \c; OpenBSD echo(1) -e (\c) |
| all four | printf equivalents | The Solnix page says the Solaris 2.6 style /usr/bin/echo equals printf "%b\n" "$*". It recommends printf for new applications. The Linux, FreeBSD, OpenBSD and NetBSD pages also point to printf(1) for portability.Source: Solnix echo(1) USAGE; Linux echo(1) DESCRIPTION; FreeBSD echo(1) CAVEATS; OpenBSD echo(1) STANDARDS; NetBSD echo(1) DESCRIPTION |
| OpenBSD | XSI conflict | OpenBSD says its -E, -e and -n conflict with the X/Open System Interfaces option of POSIX.1-2008, which says they should be treated as part of string. Solnix /usr/bin/echo treats -n as a string.Source: OpenBSD echo(1) STANDARDS; Solnix echo(1) OPERANDS |
Standards
- POSIX: echo is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Committed. The Standard attribute says see standards(7). CSI: Enabled.
- FreeBSD: The echo utility conforms to IEEE Std 1003.1-2001 (“POSIX.1”) as amended by Cor. 1-2002. The
-noption and \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. - NetBSD: The echo utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible.
- Linux: The Linux page has no STANDARDS section.
Writing portable scripts
- Use printf instead of echo for anything with
-n, backslashes or a leading hyphen. All five pages point to printf, and the Solnix USAGE section says portable applications should not use-nas the first argument or escape sequences. - On Solnix, use the full path
/usr/bin/echoto bypass the shell builtin. Its behaviour differs between sh, ksh and csh.
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.