dc(1) on Solnix vs Linux and the BSDs

On Solnix, dc is the illumos dc at /usr/bin/dc. It accepts only an optional file name: there is no -e, -f or -x, so expressions must come from a file or standard input. Linux and the BSDs all accept -e, and the Linux and FreeBSD pages add more options.

What Solnix runs

A default Solnix system runs the illumos /usr/bin/dc. /usr/xpg6/bin/dc is also shipped with the same synopsis. The two differ only in division: the xpg6 page says division results are forced to a scale of 20. The Solnix page documents no environment variables and no exit status.

Differences

Compared withTopicWhat differs
all four-e expressionSolnix dc has no -e. The synopsis is only dc [filename]. Linux, FreeBSD, OpenBSD and NetBSD all accept -e, so dc -e '2 3+p' fails on Solnix. Pipe the text in instead, for example echo '2 3+p' | dc.
Source: Solnix dc(1) SYNOPSIS; Linux dc(1) -e; FreeBSD dc(1) -e; OpenBSD dc(1) -e; NetBSD dc(1) -e
Linux, FreeBSD-f, long options and -V/-hSolnix dc has no -f, no --expression/--file long options, and no -V or -h. Linux has -f, -V, -h and --max-recursion. FreeBSD has -f, -h and many long options (--ibase, --obase, --scale, --seed and others).
Source: Solnix dc(1) SYNOPSIS; Linux dc(1) OPTIONS; FreeBSD dc(1) SYNOPSIS, OPTIONS
FreeBSD, OpenBSD, NetBSD-x extended registersSolnix dc has no -x. OpenBSD and NetBSD -x enables extended register mode, with more than 256 registers. FreeBSD offers it as -x/--extended-register. The Solnix page says register x may be any character and describes no extended mode.
Source: OpenBSD dc(1) -x; NetBSD dc(1) -x; FreeBSD dc(1) SYNOPSIS; Solnix dc(1) USAGE (sx)
FreeBSD, OpenBSD, NetBSDfile then stdinOn Solnix, if a file is given, input is read from it to its end and then from standard input. On FreeBSD, OpenBSD and NetBSD, once files or expressions are processed, dc exits and does not read stdin.
Source: Solnix dc(1) DESCRIPTION; FreeBSD dc(1) DESCRIPTION; OpenBSD dc(1) DESCRIPTION; NetBSD dc(1) DESCRIPTION
Linux, OpenBSD, NetBSDhex digits in numbersThe Solnix page describes a number as an unbroken string of the digits 0-9 (with optional _ and decimal points). Linux, OpenBSD and NetBSD pages also allow the letters A-F as digits with values 10-15.
Source: Solnix dc(1) USAGE (number); Linux dc(1) DESCRIPTION; OpenBSD dc(1) number; NetBSD dc(1) number
Linux, OpenBSD, NetBSD~ divide-and-remainderSolnix lists only + - / * % ^ as arithmetic operators. Linux, OpenBSD and NetBSD also have ~, which pushes the quotient and then the remainder. Linux also has | for modular exponentiation.
Source: Solnix dc(1) USAGE (+ - / * % ^); Linux dc(1) Arithmetic (~, |); OpenBSD dc(1) (+ - / * % ~ ^); NetBSD dc(1) (+ - / * % ~ ^)
Linux, OpenBSD, NetBSDn commandSolnix documents no n command. Linux, OpenBSD and NetBSD pop the top value and print it without a newline. OpenBSD and NetBSD mark n as a non-portable extension. Solnix has P and p for printing.
Source: Solnix dc(1) USAGE; Linux dc(1) Printing Commands (n); OpenBSD dc(1) n; NetBSD dc(1) n
OpenBSD, NetBSDother extension commandsOpenBSD and NetBSD document a, e, G, N, J and M, most marked non-portable extensions. Solnix documents none of them. Solnix has Y (debugging output), ? (read a line and execute it) and ! (run the rest of the line as a shell command).
Source: OpenBSD dc(1) a, e, G, N, J, M; NetBSD dc(1) a, e, G, N, J, M; Solnix dc(1) USAGE (Y, ?, !)
FreeBSDFreeBSD options and DC_ENV_ARGSFreeBSD dc has presets that Solnix does not: -I, -O and -S set ibase, obase and scale from the command line; the DC_ENV_ARGS environment variable supplies default options; -c/-C control digit clamping. The Solnix page documents no environment variable.
Source: FreeBSD dc(1) -I, -O, -S, -c, -C, DESCRIPTION (DC_ENV_ARGS); Solnix dc(1) (no ENVIRONMENT section)
all fourxpg6 division scale/usr/xpg6/bin/dc on Solnix says division results are forced to a scale of 20. It also says the scale set before division is the scale of the result; the two statements are not reconciled in the page. /usr/bin/dc uses the scale of the result. The other pages describe a single behaviour.
Source: Solnix dc(1) USAGE (/usr/xpg6/bin/dc, /usr/bin/dc); OpenBSD dc(1) (+ - / * % ~ ^)

Standards

  • POSIX: dc is not a POSIX.1-2024 utility.
  • Solnix: The page's SEE ALSO points to attributes(7); the bundle text shows no stability table or standards statement.
  • OpenBSD: The page marks ~, a, e, G, J, M, N, n and R as non-portable extensions.
  • FreeBSD: Options such as -C, -c, -E, -e, -f, -I, -i, -L, -O and -P are each marked as a non-portable extension.

Writing portable scripts

  • Do not use -e, -f or -x in portable scripts: Solnix dc lacks them. Feed commands on standard input, for example printf '%s\n' '2 3+p' | dc.
  • Stick to the common core: digits, _ for negative, + - * / % ^, p, d, k, i, o, c, f, s/l registers. Avoid ~, n, a and the BSD extension commands.

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.