From b3bd23dd0a5f287bbdfe3ed5b7423a8134417cc4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 4 Apr 2015 12:50:22 +0200 Subject: add file descriptor redirection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- info/auto-auto-complete.texinfo | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'info/auto-auto-complete.texinfo') diff --git a/info/auto-auto-complete.texinfo b/info/auto-auto-complete.texinfo index 977769e..0931933 100644 --- a/info/auto-auto-complete.texinfo +++ b/info/auto-auto-complete.texinfo @@ -17,7 +17,7 @@ @copying -Copyright @copyright{} 2014 Mattias Andrée +Copyright @copyright{} 2014, 2015 Mattias Andrée @quotation Permission is granted to copy, distribute and/or modify this document @@ -595,13 +595,13 @@ is to give it some default suggestion. The next step is to suggest the terminal's width minus 10 columns. In the Bash shell this can be calculated with -@command{$(( $(stty size | cut -d ' ' -f 2) - 10 ))}. +@command{$(( $(stty size <&2 | cut -d ' ' -f 2) - 10 ))}. @example ( ;We have cut out everything but (suggestion wrap). (suggestion wrap (verbatim none inherit 100 60) - (calc (pipe (stty size) (cut -d ' ' -f 2)) - 10) + (calc (pipe (stdin-fd (stty size) (stderr)) (cut -d ' ' -f 2)) - 10) ) ) @end example @@ -622,6 +622,25 @@ can be used. @code{(a || b || c)} @end table +It was also shown that @code{(stdin-fd (a) (stderr))} translates +into @code{a <&2}. @code{(stdin)}, @code{(stdout)} and @code{(stderr)} +translates into @code{0}, @code{1} and @code{2}, respectively. +Additional @code{(stdin-fd a b)} translates into @code{a <&b}, +@code{(stdout-fd a b)} into @code{a >&b}, @code{(stderr-fd a b)} into @code{a 2>&b} +and @code{(fd-fd a b c)} into @code{a b<>&c}. +You can also redirect to files: + +@table @code +@item (stdin a b) +@code{a < b} +@item (stdout a b) +@code{a > b} +@item (stderr a b) +@code{a 2> b} +@item (fd a b c) +@code{a b> c} +@end table + @node GNU Free Documentation License -- cgit v1.2.3-70-g09d2