On 13 August 2016 at 12:31, Connor Lane Smith <[email protected]> wrote: > IO redirection being done by separate programs, though, seems like a > wrong decision. Streaming the data through a separate process is > considerably less efficient than just setting a file descriptor to an > open file, and not always equivalent in behaviour either. For example, > `tty < $TTY` is obviously very different to `cat $TTY | tty`. In my > opinion this is a bug in your design, and needs to be fixed.
Thinking about it a little more, you could fix this problem without incorporating IO redirection into the shell. As it stands, your 'redir-box' only supports e.g. `foo | > bar` or `< bar | foo`. Instead, I suggest that you allow for more than one argument, where arguments after the first comprise a command to be executed. That is, instead, `> bar foo` or `< bar foo`. Incidentally, this exact syntax is supported by traditional shells. Additionally, you can then chain them like so: `< bar > baz foo`. Thus `< $TTY tty` can be used to solve the problem I described above. Thanks, Connor
