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.

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 withTopicWhat 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 linesSolnix 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 optionsSolnix 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, NetBSDexit status 125 and 1-125Solnix 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
OpenBSDexit status 1On 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, NetBSDthe historic - optionSolnix 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-- separatorsNetBSD 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
FreeBSDutility 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)
FreeBSDPATH search for the utilityOn 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 fourshell used for commands with argumentsThe 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/env has Interface Stability: Standard. Both /usr/bin/env and /usr/xpg4/bin/env list CSI as enabled.
  • OpenBSD: The env utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification. The flag -u is an extension to that specification.
  • NetBSD: The env utility conforms to IEEE Std 1003.2-1992 (“POSIX.2”). The -C, -u and -0 options are non-standard extensions.

Writing portable scripts

  • Stick to env [-i] name=value... utility [arg...]. Avoid -u, -0, -C, -S and -v, because Solnix env lacks them. Use -i rather 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.