/usr/bin/bash: Difference between revisions

Line 953: Line 953:


=== Duplicating File Descriptors ===
=== Duplicating File Descriptors ===
      The redirection operator
リダイレクト演算子


              [n]<&word
<code>[n]<&word</code>


      is used to duplicate input file descriptors.  If word expands to one or more digits, the file de‐
は、入力ファイル記述子を複製するために使われる。 wordが1桁以上に拡張されると、nで示されるファイル記述子はそのファイル記述子のコピーとなる。 wordの数字が入力用にオープンされているファイル記述子を指定しない場合、リダイレクションエラーが発生する。 wordが-と評価された場合、ファイル記述子nはクローズされる。 nが指定されない場合、標準入力(ファイル記述子0)が使用される。
      scriptor denoted by n is made to be a copy of that file descriptor.  If the digits in word do not
      specify  a  file  descriptor open for input, a redirection error occurs.  If word evaluates to -,
      file descriptor n is closed.  If n is not specified, the standard input (file  descriptor  0)  is
      used.


      The operator
演算子


              [n]>&word
<code>[n]>&word</code>


      is used similarly to duplicate output file descriptors.  If n is not specified, the standard out‐
は、出力ファイル記述子を複製するために同様に使われる。 nが指定されない場合、標準出力(ファイル記述子1)が使用される。 wordの数字が出力用にオープンされているファイル記述子を指定しない場合、リダイレクションエラーが発生する。 wordが-と評価された場合、ファイル記述子nはクローズされる。 特殊なケースとして、nが省略され、wordが1桁以上の数字または-に展開されない場合、標準出力と標準エラーは前述のようにリダイレクトされる。
      put (file descriptor 1) is used.  If the digits in word do not specify a file descriptor open for
      output,  a  redirection error occurs.  If word evaluates to -, file descriptor n is closed.  As a
      special case, if n is omitted, and word does not expand to one or more digits or -, the  standard
      output and standard error are redirected as described previously.


=== Moving File Descriptors ===
=== Moving File Descriptors ===