Re: [dev] s - suckless shell

From: Connor Lane Smith <cls_AT_lubutu.com>
Date: Sat, 13 Aug 2016 12:46:15 +0100

On 13 August 2016 at 12:31, Connor Lane Smith <cls_AT_lubutu.com> 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
Received on Sat Aug 13 2016 - 13:46:15 CEST

This archive was generated by hypermail 2.3.0 : Sat Aug 13 2016 - 13:48:12 CEST