I read the help read page, but still don't quite make sense. Don't know which option to use.
help read
How can I read N lines at a time using Bash?
With Bash≥4 you can use mapfile like so:
mapfile
while mapfile -t -n 10 ary && ((${#ary[@]})); do printf '%s ' "${ary[@]}" printf -- '--- SNIP --- ' done < file
That's to read 10 lines at a time.
1.4m articles
1.4m replys
5 comments
57.0k users