Read file into array: IFS=`echo -en "\n\b"` myfile1=( $( < filename ) ) Loop through array for i in ${myfile1[[@]]} do echo $i done