readarray
Read lines from
stdininto an array. More information: https://www.gnu.org/software/bash/manual/bash.html#index-readarray.
- Interactively input lines into an array:
readarray
- Read lines from a file and insert them in an array:
readarray <
- Remove [t]railing delimiters (newline by default):
readarray < -t
- Copy at most
nlines:
readarray < -n
- [s]kip the first
nlines:
readarray < -s
- Define a custom [d]elimiter:
readarray < -d
- Display help:
help mapfile
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
