unexpand(1) on Solnix vs Linux and the BSDs
On a default Solnix system, unexpand is the illumos /usr/bin/unexpand, which takes only -a and -t tablist. The published Solnix page describes the GNU coreutils unexpand from pkgs.solnix.coreutils, which adds long options, --first-only and extended tab lists. Scripts written for GNU unexpand can fail on the default command.
The manual pages
- Solnix: unexpand(1) from
pkgs.solnix.coreutils - Linux: unexpand(1) coreutils-full-9.11
- FreeBSD: unexpand(1) 15.1-RELEASE
- NetBSD: unexpand(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
unexpand
What Solnix runs
The published page (pkgs.solnix.coreutils) is GNU coreutils 9.7 unexpand, but the command on PATH by default is the illumos /usr/bin/unexpand. No other illumos variants are shipped. The illumos page documents expand and unexpand together and lists only -a and -t tablist for unexpand. To get the GNU behaviour, add pkgs.solnix.coreutils; the bundle does not say where that copy is installed.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | same program as GNU only in the package | The GNU unexpand in pkgs.solnix.coreutils is the same program as Linux unexpand: the options and tab-list syntax are identical in the two pages. The default illumos /usr/bin/unexpand is not that program.Source: Solnix unexpand(1) (coreutils) DESCRIPTION; Linux unexpand(1) DESCRIPTION; header line on default PATH |
| Linux | long options and --first-only | The default Solnix unexpand has only -a and -t. It documents no --all, --tabs, --first-only, --help or --version. GNU unexpand, on Linux and in pkgs.solnix.coreutils, has all of them.Source: Solnix default (illumos) unexpand(1) SYNOPSIS, OPTIONS; Linux unexpand(1) -a/--all, --first-only, -t/--tabs, --help, --version |
| Linux | -t implies -a, and how to undo it | Both GNU and illumos say -t makes conversion apply to all blanks, not just leading ones. GNU adds --first-only, which overrides -a and restores leading-only conversion. The illumos page offers no way to combine -t with leading-only conversion.Source: Linux unexpand(1) -t, --tabs=N (enables -a), --first-only; Solnix default (illumos) unexpand(1) -t |
| Linux | tab list syntax | illumos -t takes one argument of positive integers in strictly ascending order, separated by blanks or commas. GNU takes a comma-separated list and adds a '/' prefix (tab size after the last stop) and a '+' prefix (stops relative to the last stop).Source: Solnix default (illumos) unexpand(1) -t; Linux unexpand(1) -t, --tabs=LIST |
| Linux | stops beyond the last tab position | On illumos, with a multiple-stop list, no space-to-tab conversion happens beyond the last stop. GNU lets you set a tab size after the last stop with a '/' prefix. The GNU page does not say what happens without the prefix. Source: Solnix default (illumos) unexpand(1) -t; Linux unexpand(1) -t, --tabs=LIST |
| FreeBSD, NetBSD | -t with -a | The illumos page says that when -t is given, -a is ignored and conversion is not limited to leading blanks. The FreeBSD and NetBSD pages do not say this. FreeBSD's synopsis shows -a and -t as alternatives ([-a | -t ...]).Source: Solnix default (illumos) unexpand(1) -t; FreeBSD unexpand(1) SYNOPSIS, -a, -t; NetBSD unexpand(1) SYNOPSIS, -a |
| NetBSD | -t documented for unexpand | The NetBSD synopsis shows unexpand [-a] [-t tab1,tab2,...,tabn], but its only documented option for unexpand is -a. The tab-stop text describes expand. illumos, FreeBSD and GNU document -t for unexpand.Source: NetBSD unexpand(1) SYNOPSIS, DESCRIPTION; FreeBSD unexpand(1) -t; Solnix default (illumos) unexpand(1) -t |
| Linux | environment variables | The illumos page lists LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH as affecting expand and unexpand. The GNU page in the bundle lists none. Source: Solnix default (illumos) unexpand(1) ENVIRONMENT VARIABLES; Linux unexpand(1) |
| FreeBSD | environment variables | FreeBSD documents LANG, LC_ALL and LC_CTYPE only. illumos also lists LC_MESSAGES and NLSPATH. Source: FreeBSD unexpand(1) ENVIRONMENT; Solnix default (illumos) unexpand(1) ENVIRONMENT VARIABLES |
| Linux, NetBSD | exit status documented | illumos and FreeBSD document exit 0 on success and >0 on error. The GNU page and the NetBSD page in the bundle have no EXIT STATUS section. Source: Solnix default (illumos) unexpand(1) EXIT STATUS; FreeBSD unexpand(1) EXIT STATUS; Linux unexpand(1); NetBSD unexpand(1) |
| FreeBSD, NetBSD | one page for expand and unexpand | illumos, FreeBSD and NetBSD document expand and unexpand in one page. The GNU page covers unexpand alone and refers to expand(1) under SEE ALSO. Source: Solnix default (illumos) unexpand(1) NAME; FreeBSD unexpand(1) NAME; NetBSD unexpand(1) NAME; Solnix unexpand(1) (coreutils) SEE ALSO |
Standards
- POSIX: unexpand is a POSIX.1-2024 utility.
- Solnix: The illumos page lists Interface Stability: Standard, and CSI: enabled.
- FreeBSD: The expand and unexpand utilities conform to IEEE Std 1003.1-2001 (“POSIX.1”).
- NetBSD: The NetBSD page in the bundle has no STANDARDS section.
- Linux: The Linux page in the bundle has no STANDARDS section.
Writing portable scripts
- Use only
-aand-twith a single number or a comma-separated list. Those work on the illumos command and are documented on FreeBSD and GNU; the NetBSD page documents only-afor unexpand. - Avoid
--all,--tabsand--first-onlyin portable scripts: the default Solnix unexpand does not document them, and neither do the BSD pages. - Do not rely on a bare
-tleaving trailing blanks alone. On illumos and GNU it converts all blanks. FreeBSD and NetBSD do not say.
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.