for f in *; do file=$(echo $f | tr ‘ ‘ ) [ ! -f $file ] && mv “$f” $file done
This entry was posted on Wednesday, March 11th, 2009 at 4:21 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
2 Responses to “Thay Space trong File name với Underscore”
11-03-09 at 5:54 pm |
Hai dòng giữa có thể thay bằng
mv “$f” “${f// /_}”
11-03-09 at 6:02 pm |
Mình chân thành đề nghị bạn Bi viết cái “regex cho gà”.