[ale] Fun bash thing

Charles Shapiro hooterpincher at gmail.com
Sat Nov 9 10:08:56 EST 2024


Learned this off mastodon today.

**

Here's an interesting Bash pattern I just used for the first time.

some-command <<<"$(< some/file)" >some/file

It reads all of some/file into memory before writing it to some-command's
stdin. This lets some-command's stdout be redirected to some/file without
the usual problems of reading/writing from the same file.

**


H/T to @trs at metasocial.com <trs at metasocial.com>


-- CHS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.ale.org/pipermail/ale/attachments/20241109/9b5eddf5/attachment.htm>


More information about the Ale mailing list