EmilyDirsh / hotwire-shell

Automatically exported from code.google.com/p/hotwire-shell
Other
0 stars 0 forks source link

stderr I/O redirection for SysBuiltin #162

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It would be useful to support stdout/stderr redirection for external
commands.  My initial thoughts on implementation for this is that we add a
new flag redirection_passthrough=True for builtins.  If that's set, then
the core doesn't parse > and < itself, but passes them through as
arguments.  So then the SysBuiltin could deal with them itself.  

We'd keep the current semantics for:

foo >/dev/null

Unlike a regular Unix shell, this would by default redirect both stdout and
stderr.  To achieve redirection of just one, I'd imagine a syntax like this:

foo 2>/dev/null

foo 1>/dev/null

So if you specify "2" or "1" as a prefix, then it overrides the default
merge semantics.

Original issue reported on code.google.com by cgwalt...@gmail.com on 3 Mar 2008 at 6:42