3 ms·
While reading the examples, I was surprised by the placement of the output redirection statement: $ pup < robots.html title For some reason I thought that
by nikital 12y ago
While reading the examples, I was surprised by the placement of the output redirection statement:
$ pup < robots.html title
For some reason I thought that it must come last. Turns out that you can place it anywhere in the command! All these are equivalent in bash:
$ pup title < robots.html
$ pup < robots.html title
$ < robots.html pup title
- userbinator 12y agoFor readability, redirections are usually placed last but indeed they can be intermixed with all the other words in the command and this is specified by the POSIX standard (so it's not bash-specific either): http://pubs.opengroup.org/onlinepubs/009604599/utilities/xcu_chap02.html#tag_02_09_01 http://pubs.opengroup.org/onlinepubs/009604599/utilities/xcu... 'A "simple command" is a sequence of optional variable assignments and redirections, in any sequence, optionally followed by words and redirections, terminated by a control operator.'