Sujet : Re: Piping commands to a shell but keeping interactivity
De : james.harris.1 (at) *nospam* gmail.com (James Harris)
Groupes : comp.os.linux.miscDate : 07. Mar 2024, 17:04:29
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uscoid$14l6b$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 26/02/2024 13:29, Ralf Fassel wrote:
* James Harris <james.harris.1@gmail.com>
..
| Anyone know why the latter example is different? And is there a way to
| change the command to put sh at the end rather than the beginning?
Because <(cmd) produces a (temporary) file name which is added to the
cmd as first argument (cf. "man bash"). Therefore the command executed
is actually
sh filename
where stdin is still available.
Process Substitution
Process substitution allows a process's input or output to be referred
to using a filename. It takes the form of <(list) or >(list). The
process list is run asynchronously, and its input or output appears as
a filename. This filename is passed as an argument to the current com-
mand as the result of the expansion. [...] If the <(list) form
is used, the file passed as an argument should be read to obtain the
output of list.
Thanks. That's very clear.
-- James Harris