From 3573ab44e7a041f83dab1dc56ed0b77b8d18d996 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 6 Sep 2013 14:09:08 +0100 Subject: 31658: fix manual entry about getting lines from mapfile --- Doc/Zsh/mod_mapfile.yo | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Doc') diff --git a/Doc/Zsh/mod_mapfile.yo b/Doc/Zsh/mod_mapfile.yo index 98114aea2..96e056816 100644 --- a/Doc/Zsh/mod_mapfile.yo +++ b/Doc/Zsh/mod_mapfile.yo @@ -28,9 +28,12 @@ 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())'. -The double quotes are necessary to prevent empty lines from being -removed. +`var(array)tt(=LPAR()"${(f@)mapfile[)var(filename)tt(]}"RPAR())'. +The double quotes and the `tt(@)' are necessary to prevent empty lines +from being removed. Note that if the file ends with a newline, +the shell will split on the final newline, generating an additional +empty field; this can be suppressed by using +`var(array)tt(=LPAR()"${(f@)${mapfile[)var(filename)tt(]%$'\n'}}"RPAR())'. ) enditem() -- cgit 1.4.1