ARG_MAX| Shells | whatshell | portability | permissions | UUOC | ancient | - | ../Various | HOME
$@" | echo/printf | set -e | test | tty defs | tty chars |
)| IFS | using siginfo | nanosleep | line charset | locale
This page doesn't serve any special purpose, it's just about subtle differences in IFS implementations.
2011-03-12 (see recent changes)
A variable assignment is not subject to word splitting,
no matter what
IFS is used.
However: the variables
$@ are special.
The actual behaviour varies among different shells.
The following results have been collected like this:
set . . ; IFS='x' var=$*; printf '%s ' "$var" var=$@; printf '%s ' "$var" var="$*"; printf '%s ' "$var" var="$@"; printf '%s\n' "$var"
Blanks are substituted with underscores to make reading easy.
The second table at the right illustrates another issue:
how is splitting with
set influenced by
(commas mean separated values)
||| The default |
zsh comes with an additional null byte
Originally, it was not possible to unset |
should be as if
zsh-4.1.1 is the last version with this bug.
|| Columns with questionmark: not specified for the SUSv3 shell.
|traditional ash:||original Almquist shell, BSDi/OS 4.2, Minix 3.1.1, NetBSD-1.2|
|recent ash:||NetBSD 1.3, and thus all debian ash, FreeBSD 3.1|
|ksh88:||HP-UX 11 (ksh88-c), AIX 3.2 (ksh88-d), UnixWare 7.1.4 (ksh88-g, M-ksh88-h), SunO 5.9 (M-ksh88-i)|
|ksh93:||UnixWare 7.1.4 (M-ksh93-d, ksh93-e), SunOS 5.9 (M-ksh93-d), Linux (ksh93-q)|
There's also no pathname expansion in assignments.
Another place where Bourne and bourne-compatible shells don't
apply expansions is:
The traditional variants of Bourne and
Almquist shell don't apply expansions after redirection operators:
There's a divergence with the
See also Stéphane Chazelas remarks about