bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Comments on bash 5.2's undocumented <(<file) and weird >(<file)


From: Emanuele Torre
Subject: Comments on bash 5.2's undocumented <(<file) and weird >(<file)
Date: Fri, 5 Jul 2024 20:38:38 +0200
User-agent: Mutt/2.2.13 (00d56288) (2024-03-09)

Bash 5.2 apparently added  <(< file)  that expand to the path to a fifo
(openable only for read on BSD) to which the contents of file are
written to, without documenting it.

It also added  >(< file)  which is rather weird and fun; it expands to
the path to a fifo (openable only for write on BSD), but (< file) will
still write the contents of file to stdout even though >() didn't
redirect stdout, so the content of file are not written to the fifo, but
to caller's stdout.

Effectively  : >(<file)  is a pure bash cat now:

    bash-5.2$ echo Hello World > file
    bash-5.2$ : >(<file)
    Hello World
    bash-5.2$ printf hi >> file
    bash-5.2$ : >(<file)
    Hello World
    hibash-5.2$ 

o/
 emanuele6



reply via email to

[Prev in Thread] Current Thread [Next in Thread]