[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: why does </proc/self/environ not work in bash?
From: |
Zachary Santer |
Subject: |
Re: why does </proc/self/environ not work in bash? |
Date: |
Mon, 12 Feb 2024 12:44:41 -0500 |
On Mon, Feb 12, 2024 at 10:14 AM Chet Ramey <chet.ramey@case.edu> wrote:
> A system call tracer helps here. You'll find that the shell forks,
> sets up the redirection by opening /proc/self/environ, then execs tr,
> which reads the open file descriptor it inherits through execve.
>
It seems you'd be losing nothing in terms of optimization by evaluating the
word representing the file that's being redirected to or from before the
fork takes place, which would avoid this little bit of weirdness:
On Sun, Feb 11, 2024 at 5:51 PM Lawrence Velázquez <vq@larryv.me> wrote:
>
> https://mywiki.wooledge.org/BashPitfalls#cmd_.3E_.22file.24.28.28i.2B-.2B-.29.29.22
Point 64, there.
- Re: why does </proc/self/environ not work in bash?, (continued)
- Re: why does </proc/self/environ not work in bash?, Lawrence Velázquez, 2024/02/12
- Re: why does </proc/self/environ not work in bash?, Chet Ramey, 2024/02/13
- Re: why does </proc/self/environ not work in bash?, Chet Ramey, 2024/02/13
- Re: why does </proc/self/environ not work in bash?, Kerin Millar, 2024/02/11
- Re: why does </proc/self/environ not work in bash?, Christoph Anton Mitterer, 2024/02/11
Re: why does </proc/self/environ not work in bash?, Greg Wooledge, 2024/02/11
Re: why does </proc/self/environ not work in bash?, Chet Ramey, 2024/02/12
- Re: why does </proc/self/environ not work in bash?,
Zachary Santer <=
- Re: why does </proc/self/environ not work in bash?, Chet Ramey, 2024/02/12
- Re: why does </proc/self/environ not work in bash?, Zachary Santer, 2024/02/12
- Re: why does </proc/self/environ not work in bash?, Chet Ramey, 2024/02/13
- Re: why does </proc/self/environ not work in bash?, Zachary Santer, 2024/02/13
- Re: why does </proc/self/environ not work in bash?, Chet Ramey, 2024/02/13
- Re: why does </proc/self/environ not work in bash?, Zachary Santer, 2024/02/13
- Re: why does </proc/self/environ not work in bash?, Chet Ramey, 2024/02/13
- Re: why does </proc/self/environ not work in bash?, Zachary Santer, 2024/02/14
- Re: why does </proc/self/environ not work in bash?, Chet Ramey, 2024/02/14
- Re: why does </proc/self/environ not work in bash?, Zachary Santer, 2024/02/14