[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mapfile -n seeks ahead an extra line

From: Dan Douglas
Subject: mapfile -n seeks ahead an extra line
Date: Wed, 20 Jun 2012 02:09:53 -0500
User-agent: KMail/4.8.3 (Linux/3.4.2-pf+; KDE/4.8.3; x86_64; ; )

From: Dan Douglas
To: address@hidden
Subject: mapfile -n seeks ahead an extra line

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: x86_64-pc-linux-gnu-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I. -I./include -I. -I./include -I./lib  
-DSYS_BASHRC='/etc/bash/bashrc' -DSYS_BASH_LOGOUT='/etc/bash/bash_logout' 
-pipe -floop-interchange -floop-strip-mine -floop-block -ggdb
uname output: Linux smorgbox 3.4.2-pf+ #62 SMP PREEMPT Mon Jun 11 16:24:00 CDT 
2012 x86_64 Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz GenuineIntel GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.2
Patch Level: 29
Release Status: release

    mapfile -n eats a line too many, discarding the last.

    $ printf '%s\n' {a..f} | { mapfile -tn 2 a; mapfile -t b; declare -p a b; }
    declare -a a='([0]="a" [1]="b")'
    declare -a b='([0]="d" [1]="e" [2]="f")'

Attachment: signature.asc
Description: This is a digitally signed message part.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]