1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2026-01-01 20:11:06 +01:00

43694: More detail on multios.

Mention how opening files in multios differs from cat.
This commit is contained in:
Peter Stephenson 2018-10-17 17:05:31 +01:00
parent ef58491092
commit 079f7f9d48
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2018-10-17 Peter Stephenson <p.stephenson@samsung.com>
* 43694: Doc/Zsh/redirect.yo: More detail on how multio file
opening differs from cat.
2018-10-17 Oliver Kiddle <okiddle@yahoo.co.uk>
* 43697: Completion/X/Command/_zathura: match uppercase

View file

@ -235,6 +235,9 @@ example(date >foo | cat)
writes the date to the file `tt(foo)', and also pipes it to cat.
Note that the shell opens all the files to be used in the multio process
immediately, not at the point they are about to be written.
Note also that redirections are always expanded in order. This happens
regardless of the setting of the tt(MULTIOS) option, but with the option
in effect there are additional consequences. For example,
@ -269,9 +272,13 @@ example(echo exit 0 >> *.sh)
If the user tries to open a file descriptor for reading more than once,
the shell opens the file descriptor as a pipe to a process that copies
all the specified inputs to its output in the order
specified, similar to bf(cat),
provided the tt(MULTIOS) option is set. Thus
all the specified inputs to its output in the order specified, provided
the tt(MULTIOS) option is set. It should be noted that each file is
opened immediately, not at the point where it is about to be read:
this behaviour differs from tt(cat), so if strictly standard behaviour
is needed, tt(cat) should be used instead.
Thus
example(sort <foo <fubar)