I try to search for files that may contain white spaces I try to use -print0
and set IFS
here is my script
IFS=$'';find people -name '*.svg' -print0 | while read file; do
grep '<image' $file > /dev/null && echo $file | tee -a embeded_images.txt;
done
I try to fine all svg file containing embeded images, it work without -print0 but fail one one file so I stop the script. Here is simpler example that don't work too
IFS=$'';find . -print0 | while read file; do echo $file; done
it don't display anything.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…