useful sed one liner in bash
Wed 22 July 2009I was about to upload some documents to my company's wiki that someone else wrote. Upload failed! For some odd reason they chose to use a '+' instead of a space or under bar in the filename. Here is how I fixed it.
for i in `ls -1`; do
old=${i}
new=`echo ${old} |sed -e 's/\+/\_/g'`
echo "moving ${old} to ${new}"
mv ${old} ${new}
done