You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/freefeatures.rst
+3-21Lines changed: 3 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,26 +100,8 @@ As in a Unix shell, output of a command can be redirected:
100
100
- appended to a file with ``>>``, as in ``mycommand args >> filename.txt``
101
101
- piped (``|``) as input to operating-system commands, as in
102
102
``mycommand args | wc``
103
-
- sent to the paste buffer, ready for the next Copy operation, by
104
-
ending with a bare ``>``, as in ``mycommand args >``.. Redirecting
105
-
to paste buffer requires software to be installed on the operating
106
-
system, pywin32_ on Windows or xclip_ on \*nix.
103
+
- sent to the operating system paste buffer, by ending with a bare ``>``, as in ``mycommand args >``. You can even append output to the current contents of the paste buffer by ending your command with ``>>``.
107
104
108
-
If your application depends on mathematical syntax, ``>`` may be a bad
109
-
choice for redirecting output - it will prevent you from using the
110
-
greater-than sign in your actual user commands. You can override your
111
-
app's value of ``self.redirector`` to use a different string for output redirection::
112
-
113
-
class MyApp(cmd2.Cmd):
114
-
redirector = '->'
115
-
116
-
::
117
-
118
-
(Cmd) say line1 -> out.txt
119
-
(Cmd) say line2 ->-> out.txt
120
-
(Cmd) !cat out.txt
121
-
line1
122
-
line2
123
105
124
106
.. note::
125
107
@@ -136,8 +118,8 @@ app's value of ``self.redirector`` to use a different string for output redirect
136
118
arguments after them from the command line arguments accordingly. But output from a command will not be redirected
0 commit comments