summary refs log tree commit diff
path: root/Doc/Zsh
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-09-18 10:55:43 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-09-18 10:55:43 +0000
commitd3e90df780c55069c56f9bd657ee5da4a0fde9a1 (patch)
tree8a97c22205a89961614dc0de5cfba36f624a081e /Doc/Zsh
parente4d3ee06b39043901054f1f20682a2e79c9f1924 (diff)
downloadzsh-d3e90df780c55069c56f9bd657ee5da4a0fde9a1.tar.gz
zsh-d3e90df780c55069c56f9bd657ee5da4a0fde9a1.tar.xz
zsh-d3e90df780c55069c56f9bd657ee5da4a0fde9a1.zip
users/13239: add some comments to mapfile doc
Diffstat (limited to 'Doc/Zsh')
-rw-r--r--Doc/Zsh/mod_mapfile.yo9
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/Zsh/mod_mapfile.yo b/Doc/Zsh/mod_mapfile.yo
index 496d8a915..9a46ff895 100644
--- a/Doc/Zsh/mod_mapfile.yo
+++ b/Doc/Zsh/mod_mapfile.yo
@@ -25,15 +25,18 @@ every file in the current directory without the usual `tt(rm *)' test.
 
 The parameter tt(mapfile) may be made read-only; in that case, files
 referenced may not be written or deleted.
+
+A file may conveniently be read into an array as one line per element
+with the form `var(array)tt(=LPAR()${(f)mapfile[)var(filename)tt(]RPAR())'.
 )
 enditem()
 
 subsect(Limitations)
 
 Although reading and writing of the file in question is efficiently
-handled, zsh's internal memory management may be arbitrarily baroque.  Thus
-it should not automatically be assumed that use of tt(mapfile) represents a
-gain in efficiency over use of other mechanisms.  Note in particular that
+handled, zsh's internal memory management may be arbitrarily baroque;
+however, tt(mapfile) is usually very much more efficient than
+anything involving a loop.  Note in particular that
 the whole contents of the file will always reside physically in memory when
 accessed (possibly multiple times, due to standard parameter substitution
 operations).  In particular, this means handling of sufficiently long files