help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why does </proc/self/environ not work in bash?


From: Lawrence Velázquez
Subject: Re: why does </proc/self/environ not work in bash?
Date: Sun, 11 Feb 2024 17:50:47 -0500
User-agent: Cyrus-JMAP/3.11.0-alpha0-144-ge5821d614e-fm-20240125.002-ge5821d61

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]