On Sat, Feb 10, 2024, at 11:16 PM, Koichi Murase wrote:
> 2024年2月11日(日) 13:01 Christoph Anton Mitterer <calestyo@scientia.org>:
>> Which would be what I'd expect if one did e.g.
>> $ cat /proc/self/comm
>> where the program get's the path as argument and opens it, but not
>> when doing:
>> $ cat </proc/self/comm
>
> I haven't checked how Bash actually implements it in the codebase, but
> redirections can be performed in different places depending on the
> implementation. One could open the file in the parent process and
> perform fork&exec as a possible implementation, but as another
> implementation, one can first perform the fork, perform the
> redirection, and finally perform the exec.https://mywiki.wooledge.org/BashPitfalls#cmd_.3E_.22file.24.28.28i.2B-.2B-.29.29.22
--
vq