I would like to split a text file with IFS my text file looks like :
name1
name2
name3
name4
I want to read this file and get name by name here is my code :
names=$(</text.txt)
IFS='\n' read -a -r names_list <<< "$names"
for name in "${names_list[@]}"
do
echo "$name"
done
it's always showing the first name and not the others, any solution ?