Looking at the man page for
rename (possibly a different version than yours) the syntax is
Code:
rename from to file ...
with an example for fixing HTM to HTML files:
Code:
rename .htm .html *.htm
So I would expect that
Code:
rename file\ name file_name file\ name
might work for you -- you use the back slant to "escape" the blank in the file name.
This all assumes, of course, that you can write on the device (and I don't really know if that's possible -- try it on something you don't care about, eh).
Hope this helps some.
Just as an aside, I have this little utility that renames blanks in file name to underscores; I don't know who the author is or where I got it (sorry!), but it might be of use when dealing with Miserydos files:
Code:
cat blank-rename.sh
#!/bin/bash
ONE=1 # For getting singular/plural right (see below).
number=0 # Keeps track of how many files actually renamed.
FOUND=0 # Successful return value.
for filename in * # Traverse all files in directory.
do
echo "$filename" | grep -q " " # Check whether filename
if [ $? -eq $FOUND ] #+ contains space(s).
then
fname=$filename # Yes, this filename needs work.
n=`echo $fname | sed -e "s/ /_/g"` # Substitute underscore for blank.
mv "$fname" "$n" # Do the actual renaming.
let "number += 1"
fi
done
if [ "${number}" -eq "$ONE" ] # For correct grammar.
then
echo "${number} file renamed."
else
echo "${number} files renamed."
fi
exit 0