用 tr :
find . -type f -name "* *" -print |
while read name; do
na=$(echo $name | tr ' ' '_')
if [[ $name != $na ]]; then
mv "$name" $na
fi
done
参考:[http://www.eygle.com/digest/2006/11/linux_replace_blank.html
用 tr :
find . -type f -name "* *" -print |
while read name; do
na=$(echo $name | tr ' ' '_')
if [[ $name != $na ]]; then
mv "$name" $na
fi
done
参考:[http://www.eygle.com/digest/2006/11/linux_replace_blank.html