env(1) on Solnix vs Linux and the BSDs
On Solnix, env is the illumos env at /usr/bin/env. It supports only -i (or the historic -), name=value operands, and a command. It has none of the extensions Linux and the BSDs add: -u, -0, -C and -S.
The manual pages
- Solnix: env(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: env(1) coreutils-full-9.11
- FreeBSD: env(1) 15.1-RELEASE
- OpenBSD: env(1) 8.0
- NetBSD: env(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
env
What Solnix runs
A default Solnix system runs the illumos /usr/bin/env. /usr/xpg4/bin/env is also shipped. Its page gives the same options and operands, and its ATTRIBUTES table lists Interface Stability as Standard. The page describes no behavioural difference between the two.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| all four | -u (unset a variable) | Solnix env has no -u, so it cannot remove a single variable. Linux, FreeBSD, OpenBSD and NetBSD all accept -u name. On Solnix the only documented way to drop variables is -i, which discards the whole inherited environment.Source: Solnix env(1) SYNOPSIS and OPTIONS (-i only); Linux env(1) -u; FreeBSD env(1) -u; OpenBSD env(1) -u; NetBSD env(1) -u |
| Linux, FreeBSD, NetBSD | -0 (NUL-terminated output) | Solnix env, when it prints the environment, writes one name=value pair per line and has no -0. Linux, FreeBSD and NetBSD accept -0 to end each line with NUL. Output with newlines in values is ambiguous on Solnix.Source: Solnix env(1) DESCRIPTION; Linux env(1) -0, --null; FreeBSD env(1) -0; NetBSD env(1) -0 |
| Linux, FreeBSD, NetBSD | -C (change directory) | Solnix env has no -C. Linux (-C, --chdir), FreeBSD (-C altwd) and NetBSD (-C dir) change the working directory before running the command. NetBSD also removes PWD from the environment.Source: Solnix env(1) SYNOPSIS; Linux env(1) -C; FreeBSD env(1) -C; NetBSD env(1) -C |
| Linux, FreeBSD | -S (split string) for shebang lines | Solnix env has no -S. Linux and FreeBSD use -S to split one string into several arguments, which the Linux page says is for passing multiple arguments on shebang lines. OpenBSD and NetBSD have no -S either.Source: Solnix env(1) SYNOPSIS; Linux env(1) -S, --split-string; FreeBSD env(1) -S and Details of -S processing |
| Linux, FreeBSD | -v and other extra options | Solnix env has no -v or long options. Linux and FreeBSD offer -v to print each processing step. Linux adds -a, --block-signal, --default-signal, --ignore-signal, --list-signal-handling, --help and --version. FreeBSD adds -P, and -L/-U for login.conf variables.Source: Solnix env(1) SYNOPSIS; Linux env(1) -v, -a, --block-signal; FreeBSD env(1) -v, -L, -U, -P |
| Linux, NetBSD | exit status 125 and 1-125 | Solnix says 1-125 means an error occurred, so env's own failures share the range with utility's exit codes. Linux and NetBSD reserve 125 for env's own failure. All of them use 126 for a command that cannot be invoked and 127 for one that is not found. Source: Solnix env(1) EXIT STATUS; Linux env(1) Exit status; NetBSD env(1) EXIT STATUS |
| OpenBSD | exit status 1 | On OpenBSD, 1 means an invalid option was given or the utility itself exited 1, and 2-125 and 128-255 are the utility's own codes. Solnix reports any env error as 1-125, and its page does not document OpenBSD's invalid-option case separately. Source: OpenBSD env(1) EXIT STATUS; Solnix env(1) EXIT STATUS |
| Linux, OpenBSD, NetBSD | the historic - option | Solnix lists -i and - as equivalent. Linux says a mere - implies -i. OpenBSD and NetBSD say the historic - option is deprecated but still supported, so prefer -i.Source: Solnix env(1) OPTIONS (-i | -); Linux env(1) DESCRIPTION; OpenBSD env(1) STANDARDS; NetBSD env(1) COMPATIBILITY |
| NetBSD | -- separators | NetBSD documents two -- arguments. The first ends the options, which allows a name or utility starting with -. The second ends the name=value list, which allows a utility name containing =. The Solnix page documents no -- handling. Source: NetBSD env(1) DESCRIPTION and SYNOPSIS; Solnix env(1) SYNOPSIS and OPERANDS |
| FreeBSD | utility names containing = | FreeBSD says env cannot run a utility whose name contains =, and suggests interposing command(1). The Solnix page does not address this case. It only says the result is undefined if utility names a special shell built-in. Source: FreeBSD env(1) DESCRIPTION; Solnix env(1) OPERANDS (utility) |
| FreeBSD | PATH search for the utility | On Solnix, a PATH=value operand is used when searching for utility. FreeBSD offers -P altpath to search other directories without changing PATH in the environment. The Solnix page has no equivalent option.Source: Solnix env(1) ENVIRONMENT VARIABLES (PATH); FreeBSD env(1) -P |
| all four | shell used for commands with arguments | The Solnix page says that when env executes commands with arguments it uses the default shell /usr/bin/sh. The Linux, FreeBSD, OpenBSD and NetBSD pages in the bundle say nothing about a shell.Source: Solnix env(1) DESCRIPTION; Linux, FreeBSD, OpenBSD and NetBSD env(1) DESCRIPTION |
Standards
- POSIX: env is a POSIX.1-2024 utility.
- Solnix:
/usr/xpg4/bin/envhas Interface Stability: Standard. Both/usr/bin/envand/usr/xpg4/bin/envlist CSI as enabled. - OpenBSD: The env utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification. The flag
-uis an extension to that specification. - NetBSD: The env utility conforms to IEEE Std 1003.2-1992 (“POSIX.2”). The
-C,-uand-0options are non-standard extensions.
Writing portable scripts
- Stick to env [
-i] name=value... utility [arg...]. Avoid-u,-0,-C,-Sand-v, because Solnix env lacks them. Use-irather than the deprecated -. - To drop one variable portably, unset it in a shell (sh
-c'unset VAR; exec cmd') instead of relying on env-u. - Do not depend on env's own error exit code. Solnix gives 1-125 for errors, while Linux and NetBSD use 125 and OpenBSD uses 1.
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.