<div dir="auto">I've done similar but usually output to a different file using the some-command as an extractor/processor often for line-by-line mangling. Did not know it dumps the entire input file into memory first. Hmm. That has possibilities as well as potential gotchas related to size. Usually the memory is not a problem but if the system is already in heavy use it could be impactful.<div dir="auto"><br></div><div dir="auto">Nice. Very nice.</div><div dir="auto"><br></div><div dir="auto">My latest fun toy is a grep to find what is in fileA that's not in fileB with one item per line for each.</div><div dir="auto"><br></div><div dir="auto">grep -Fvxf fileB fileA</div><div dir="auto"><br></div><div dir="auto">Really useful for finding kernel sysctl setting changes between large systems. Thousand line files are ms times. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 9, 2024, 10:09 AM Charles Shapiro via Ale <<a href="mailto:ale@ale.org">ale@ale.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Learned this off mastodon today.</div><div><br></div><div>**<br></div><div><div><div lang="en"><p>Here's an interesting Bash pattern I just used for the first time.</p><p> some-command <<<"$(< some/file)" >some/file</p><p>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.</p><p>**</p><p><br></p><p>H/T to <a class="gmail_plusreply" id="m_-2651914764147288285plusReplyChip-0" href="mailto:trs@metasocial.com" target="_blank" rel="noreferrer">@trs@metasocial.com</a> <br></p><p><br></p><p>-- CHS<br></p></div></div></div></div>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank" rel="noreferrer">Ale@ale.org</a><br>
<a href="https://mail.ale.org/mailman/listinfo/ale" rel="noreferrer noreferrer" target="_blank">https://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div>