Read fields of a file into an array

suggest change

Let’s assume that the field separator is :

arr=()
while IFS= read -d : -r field || [ -n "$field" ]; do
   arr+=("$field")
done <file

Feedback about page:

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



Table Of Contents