[TUHS] Use of "{}" in the Shell?
Alexis via TUHS
tuhs at tuhs.org
Tue Aug 4 09:08:38 AEST 2026
Dave Horsfall via TUHS <tuhs at tuhs.org> writes:
> A long time ago, in a Unix manpage far away, I saw a reference
> to "{}"
> which acted similar to "()" except that it did not fork
> e.g. "{exit}" would
> do just that :-)
>
> Does anyone know the provenance of this Shell? I can't seem to
> reproduce
> it on the MacBook or the FreeBSD box here (my Penguin box is
> currently
> dead).
Well, the dash(1) man page has:
Grouping Commands Together
Commands may be grouped by writing either
(list)
or
{ list; }
The first of these executes the commands in a subshell.
Builtin commands
grouped into a (list) will not affect the current shell. The
second form
does not fork another shell so is slightly more efficient.
Alexis.
More information about the TUHS
mailing list