diff --git a/plumbum/commands.py b/plumbum/commands.py index f69a344a8..cea2e64e6 100644 --- a/plumbum/commands.py +++ b/plumbum/commands.py @@ -191,6 +191,10 @@ def __gt__(self, file): """Redirects the process' stdout to the given file""" return StdoutRedirection(self, file) + def __rshift__(self, file): + """Redirects the process' stdout to the given file (appending)""" + return AppendingStdoutRedirection(self, file) + def __ge__(self, file): """Redirects the process' stderr to the given file""" return StderrRedirection(self, file) @@ -421,6 +425,12 @@ class StdoutRedirection(BaseRedirection): KWARG = "stdout" MODE = "w" +class AppendingStdoutRedirection(BaseRedirection): + __slots__ = [] + SYM = ">>" + KWARG = "stdout" + MODE = "a" + class StderrRedirection(BaseRedirection): __slots__ = [] SYM = "2>"