Date: Thu, 15 Mar 2018 08:37:39 -0400 From: Greg Wooledge <wool...@eeg.ccf.org> Message-ID: <20180315123739.vd7zdj37irnt4...@eeg.ccf.org>
| That said, I think a lot of scripts *do* bend this rule and rely on | the here-document creating a seekable temp file, because this has been | the common practice across many different shells for a long time. The script itself is hardly going to care, it is more the application that is given the here-doc on stdin.. If a here doc was passed to some other fd, and the application run with /dev/fd/3 (or whichever) as an arg, it might be a bigger issue. But I doubt that there are many scripts that do things like that. As a general rule, applications that believe they can seek stdin (where here docs usually are presented) are poorly designed, if not outright broken, as it means that it isn't possible to run them as ... | application and in general, I don't think there are very many such applications. Further, there are shells (I believe all ash derived shells, at least) which do not use files for here docs (which is why it is unspecified in POSIX). I don't recall ever seeing a bug report, or anything (that matters, obviously anyone can deliberately write code that would fail) that suffers because of this. kre