help-bash
[Top][All Lists]
Advanced

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

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


From: Christoph Anton Mitterer
Subject: why does </proc/self/environ not work in bash?
Date: Sun, 11 Feb 2024 05:00:16 +0100
User-agent: Evolution 3.50.3-1

Hey there.

I stumbled over something which I cannot really explain:

Doing e.g.:
  $ tr '\000' '\n' </proc/self/environ
in bash gives no output, while e.g. in dash
it gives the env vars, as I'd have expected it.

First question here is: whose environment should/would it return? The
shell's? tr's?
I'd assume the former, because the shell sets up the redirection


But it gets even weirder when trying e.g. /proc/self/comm:
  $ tr '\000' '\n' </proc/self/comm 
in dash, gives
  dash
as I'd have expected it.

But in bash it gives:
  tr


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


Any ideas?

Thanks,
Chris.



reply via email to

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