You have to use the bash function ${foo//string1/string2}. Check the Advanced Bash-Scripting Guide for a complete list of string manipulating functions.
for foo in *; do mv "$foo" ${foo// /_}; done
Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Leave a reply