Skip to content
Prev 178969 / 398506 Next

use of "input" in system()

Mike Miller wrote:
it doesn't seem to be the usual way of explaining the matters.  the bash
reference manual [1, sec. 3.6.1] (see also man bash) says:

"
Redirection of input causes the file whose name results from the
expansion of word to be opened for reading on file descriptor |n|, or
the standard input (file descriptor 0) if |n| is not specified.

The general format for redirecting input is:

     [n]<word

"

it definitely not saying 'redirection to'.  even more contrary to what
duncan says is man page of the sh shell (man sh):

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

note the *from*.

in peters' expert shell scripting [1, ch. 9, p. 60] it is stated:

"
expression < file: Redirect the contents of file into the expression.
"

while r's "standard input of command is redirected to the file" can
certainly be read correctly once one knows what it really means, it is
an unfortunate and misleading expression, and it might be a good idea to
fix it. 

yet another example of how creative documentation is not necessarily
good documentation.

vQ