Read lines of a string into an array

suggest change
var='line 1
line 2
line3'
readarray -t arr <<< "$var"

or with a loop:

arr=()
while IFS= read -r line; do
   arr+=("$line")
done <<< "$var"

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents