read(1) on Solnix vs Linux and the BSDs
On Solnix, read(1) documents several implementations: /usr/bin/read, which takes only -r, and the sh, csh, ksh and ksh93 variants, of which ksh93 has many more options. The FreeBSD counterpart in the bundle is only the shell built-in index (builtin(1)), which lists read as an sh built-in and gives no option or behaviour details.
The manual pages
- Solnix: read(1) from
pkgs.solnix.illumos-world-man· illumos.org - FreeBSD: read(1) 15.1-RELEASE
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
read
What Solnix runs
A default Solnix system runs the illumos /usr/bin/read, and /usr/xpg4/bin/read is also shipped. The bundle does not describe how the xpg4 version differs. The Solnix page documents read for /usr/bin/read, sh, csh, ksh and ksh93. The bundle has no Linux, OpenBSD or NetBSD page for read, so nothing is claimed about those systems.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD | what the counterpart page covers | The FreeBSD page in the bundle is the builtin(1) index. It says only that read exists in sh(1). It documents no read options, operands, environment variables or exit status, so none of the Solnix read details can be compared directly. Source: FreeBSD builtin(1) Commands table (read: Standalone No*, csh No, sh Yes); Solnix read(1) SYNOPSIS, OPTIONS |
| FreeBSD | standalone read command | Solnix ships a real /usr/bin/read executable with the synopsis 'read [-r] var...'. FreeBSD marks read 'No*': it exists externally only as a script that uses the shell built-in of the same name.Source: Solnix read(1) SYNOPSIS (/usr/bin/read); FreeBSD builtin(1) Commands table and 'No*' note |
| FreeBSD | read in csh | The Solnix page documents no read command for csh. It loads a line with 'set variable = $<'. FreeBSD marks read as not provided by csh(1). The bundle does not show a FreeBSD csh equivalent. Source: Solnix read(1) SYNOPSIS and DESCRIPTION (csh); FreeBSD builtin(1) Commands table (read, csh No) |
| FreeBSD | option set depends on the shell | Solnix /usr/bin/read and ksh accept only -r. ksh93 adds -A, -d, -n, -N, -p, -s, -t, -u and -v. FreeBSD documents none of these for its sh read. Scripts that use ksh93 options need ksh93 on Solnix.Source: Solnix read(1) OPTIONS (/usr/bin/read, ksh; ksh93); FreeBSD builtin(1) lists sh(1) and csh(1) only |
| FreeBSD | effect on caller variables | The Solnix page says read run in a sub-shell or as a separate utility (for example 'nohup read' or 'find -exec read') does not set the caller's shell variables. The FreeBSD page does not say how its external read script behaves.Source: Solnix read(1) DESCRIPTION (/usr/bin/read); FreeBSD builtin(1) 'No*' note |
| FreeBSD | default variable and prompt | On Solnix, ksh and ksh93 use REPLY when no name is given, and accept 'name?prompt' to print a prompt on standard error. /usr/bin/read needs var operands. The FreeBSD page documents neither REPLY nor prompts.Source: Solnix read(1) DESCRIPTION (ksh, ksh93), SYNOPSIS; FreeBSD builtin(1) |
| FreeBSD | exit status | Solnix /usr/bin/read returns 0 on success and >0 on end-of-file or error. The Solnix sh text says the return code is 0 unless end-of-file is hit. The FreeBSD page gives no exit status for read.Source: Solnix read(1) EXIT STATUS, DESCRIPTION (sh); FreeBSD builtin(1) |
| FreeBSD | environment variables | The Solnix page lists IFS and PS2, plus LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH, as affecting read. PS2 is the continuation prompt after a trailing backslash or an unterminated here-document. The FreeBSD page lists none. Source: Solnix read(1) ENVIRONMENT VARIABLES; FreeBSD builtin(1) |
Standards
- POSIX: read is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Committed for
/usr/bin/read, csh, ksh and sh. The ksh93 row is cut off in the bundle. - FreeBSD: The FreeBSD builtin(1) text in the bundle states no standards conformance for read.
Writing portable scripts
- Use only 'read
-rvar...' in portable scripts. It is the one option/usr/bin/readand ksh share, and the other options exist only in ksh93 on Solnix. - Do not rely on read inside a sub-shell, pipeline stage or 'find
-exec' to set variables for the parent shell. The Solnix page says it will not.
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.