Bash for loop with forced LF delimiter

for f in `cat filelist.txt`; do echo "$f"; done

This code won’t work well when there are space characters in the file names in the list. For that, bash provides a way to specify the delimiter.

Below will work better.

IFS=$'\n'
for f in `cat filelist.txt`; do echo "$f"; done

changgull