Bash script for files with spaces in the filenames

Steven W. Orr steveo at syslang.net
Thu Feb 16 18:20:39 UTC 2006


On Thursday, Feb 16th 2006 at 09:19 -0600, quoth Mikkel L. Ellertson:

=>I usually use something like:
=>
=>#!/bin/bash
=>for file in *.mp3
=>do
=>  eyeD3 --force-update --set-encoding=utf8 "$file"
=>done

and that can be fixed by saying

#!/bin/bash
for file in *.mp3
do
  [[ -f "$file" ]] && eyeD3 --force-update --set-encoding=utf8 "$file"
done

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net




More information about the fedora-list mailing list