Presently, the grammar supports redirection using hard-coded numbers, nothing else.
Notably, there is no mechanism for variable expansion within a redirection:
{ foo $out_fh> error.log }
In addition, there does not appear to be a way to pass file across the {}-barrier from "hush code" to "command code". For example, there isn't a way to open a file, advance to a particular offset, then begin writing to that position in the file from a command block:
fh = fopen('some_file.txt')
fseek(fh, 100)
{ foo > $fh }
Note:
This seems like an obvious "new type". It might be a dictionary wrapped around something (a bunch of methods, plus some internal data like fileno or something), but it kind of sets the stage for "How do you add new types that require compiled code for support?" So that is probably an important question to answer, too!
Presently, the grammar supports redirection using hard-coded numbers, nothing else.
Notably, there is no mechanism for variable expansion within a redirection:
In addition, there does not appear to be a way to pass file across the {}-barrier from "hush code" to "command code". For example, there isn't a way to open a file, advance to a particular offset, then begin writing to that position in the file from a command block:
Note:
This seems like an obvious "new type". It might be a dictionary wrapped around something (a bunch of methods, plus some internal data like fileno or something), but it kind of sets the stage for "How do you add new types that require compiled code for support?" So that is probably an important question to answer, too!