[TUHS] Use of "{}" in the Shell?
Cameron Míċeál Tyre via TUHS
tuhs at tuhs.org
Tue Aug 4 09:45:18 AEST 2026
Using Peter's guidance, I tried the original command discussed, in Bash on my Macbook Air, and it worked.
{ exit 1; }
The result: https://ibb.co/xq20BMvT
Side note: I also tried on Bash on Debian sandboxed on GrapheneOS and the result was the same.
Best wishes,
Cameron
On Tuesday, 4 August 2026 at 00:24, Peter Pentchev via TUHS <tuhs at tuhs.org> wrote:
> And of course, I forgot to include an actually useful example:
> something that was pretty common back when I wrote Makefiles for fun:
>
> gzip -cn9 repopush.1 > repopush.1.gz || { rm -f repopush.1.gz; exit 1; }
> > On Tue, Aug 04, 2026 at 08:24:57AM +1000, Dave Horsfall via TUHS wrote, in part:
> > > 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 :-)
More information about the TUHS
mailing list