in reply to Re^2: how perl do 'envsubst'
in thread how perl do 'envsubst'

Yep, you can see it in action with
$ echo <(echo foo) /dev/fd/63
But, now I just realized there is still a mystery!
$ ls /dev/fd 0 1 2 3
So... how can a program open /dev/fd/63 if it doesn't exist?

Replies are listed 'Best First'.
Re^4: how perl do 'envsubst'
by jo37 (Curate) on Jul 03, 2024 at 19:55 UTC
    So... how can a program open /dev/fd/63 if it doesn't exist?

    Because it does exist at the time the command is run:

    $ echo <(echo foo) $(ls /dev/fd) /dev/fd/63 0 1 2 3 63

    Greetings,
    🐻

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
      Ah-ha! I forgot /dev/fd was a symlink to /proc/self/fd.
Re^4: how perl do 'envsubst'
by vincentaxhe (Scribe) on Jul 04, 2024 at 05:58 UTC
    if run kmonad <(echo $config), could bind to /dev/fd/61; but use perl only /dev/fd/0 is guaranteed to exist, cann't change to others;