|                          | bash            | dash                          |
|--------------------------|-----------------|-------------------------------|
| redirect stdout + stderr | `>& or &>`      | `command > file 2>&1`         |
|                          | `|& (bash4)`    | `command 2>&1 | othercommand` |
| duplicate and close      | `m>&n-` `m<&n-` | `m>&n n>&-`                   |
| herestring               | `<<<string`     | `echo | command` or `(<<EOF)` |

Redirections
  Redirections are used to change where a command reads its input or sends
  its output.  In general, redirections open, close, or duplicate an
  existing reference to a file.  The overall format used for redirection
  is:

       [n] redir-op file

  where redir-op is one of the redirection operators mentioned previously.
  Following is a list of the possible redirections.  The [n] is an optional
  number between 0 and 9, as in ‘3’ (not ‘[3]’), that refers to a file
  descriptor.

       [n]> file   Redirect standard output (or n) to file.

       [n]>| file  Same, but override the -C option.

       [n]>> file  Append standard output (or n) to file.

       [n]< file   Redirect standard input (or n) from file.

       [n1]<&n2    Copy file descriptor n2 as stdout (or fd n1).  fd n2.

       [n]<&-      Close standard input (or n).

       [n1]>&n2    Copy file descriptor n2 as stdin (or fd n1).  fd n2.

       [n]>&-      Close standard output (or n).

       [n]<> file  Open file for reading and writing on standard input (or
                   n).

  The following redirection is often called a “here-document”.

       [n]<< delimiter
             here-doc-text ...
       delimiter

  All the text on successive lines up to the delimiter is saved away and
  made available to the command on standard input, or file descriptor n if
  it is specified.  If the delimiter as specified on the initial line is
  quoted, then the here-doc-text is treated literally, otherwise the text
  is subjected to parameter expansion, command substitution, and arithmetic
  expansion (as described in the section on “Expansions”).  If the operator
  is “<<-” instead of “<<”, then leading tabs in the here-doc-text are
  stripped.
