summaryrefslogtreecommitdiff
path: root/tests/mapfile1.sub
blob: b3d77f94da9a699c29b4ea2bea6aa169c26e0c15 (plain)
1
2
3
4
5
6
7
8
9
10
11
: ${TMPDIR:=/tmp}
FILE=$TMPDIR/file

trap 'rm -f $FILE' 0 1 2 3 6 15
printf "%d\n" {1..20} > $FILE

mapfile -n 5 array < $FILE
echo ${array[@]}

mapfile -n 5 -c 1 -C "echo foo" array  < $FILE
mapfile -n 5 -c 1 -C "echo foo" array  < /dev/null