tech-userlevel archive

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

Re: Possible "new" redirect style for /bin/sh (needs a name)



Greg A. Woods wrote in
 <m1lVNaF-0036urC@more.local>:
 |At Sun, 11 Apr 2021 01:37:44 +0700, Robert Elz <kre%munnari.OZ.AU@localhost> wrote:
 |Subject: Re: Possible "new" redirect style for /bin/sh (needs a name)
 ...
 |Perhaps the current high FD watermark could even be exposed to the user
 |with a new shell variable such as ${CUR_MAX_FD}, but also/instead the

I think this is a good idea.  I think using 27>&- is not, i think
assigning to that one would be better, then.

  ...
 |The only thing that immediately jumped into my mind was "dynamic
 |redirection".

If starting with va_fds this could eventually end up as stdfds.
(Then VA_FDS_MIN or _START would come to mind.)

P.S.:
I really like the idea!  For the MUA i maintain i long have the
idea of variable (I/O) redirections in mind, because for now the
terrible syntax is, for example

  ? vexpr + 1 1
  0b 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000010
  02 | 0x2 | 2
  ? vput vexpr i + 1 1
  ? echo $i
  2

Which was a way to make it work, which is better than not being
able.  But it is really weird.  Because of the syntax constraints,
i was thinking (and am still looking forward to) things like <
and > (and maybe |) prefixes (as in maybe "? >i vexpr"), but was not
yet sure how to differentiate in between variables (memory) and
file descriptors aka file names.  Enclosing braces would be
a thing.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Home | Main Index | Thread Index | Old Index