Re:Use the Unofficial Bash Strict Mode (Unless You Love Debu...
by kazinator on Friday March 18, 2016 @05:16PM
(#11315124)
for filename in *.txt ; do ...
has no issue with spaces in filenames. If *.txt matches "foo bar.txt", then that's what the filename variable is set to. In the body of the loop you have to make sure you have "$filename".
You don't need play games with IFS to correctly process filesystem entry names expanded from a pattern.
You don't need play games with IFS to correctly process filesystem entry names expanded from a pattern.