Reading a File and Splitting Strings in Bash

Last modified: 
Tuesday, December 29th, 2015

An ad hoc Bash example of reading a file in line by line and splitting each line into an array.

while read -r line
  IFS='|' read -ra ARR <<< "$line"
  echo "Script $script, Outfile $outfile"
done < "$filename"

The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.