Rename files replacing spaces by another character

Let’s say you have a list of files with blank spaces in their name :

foie gras final 2-1.eps		
foie gras step 3.eps		
foie gras step 4.eps		
foie gras step 6.eps		
foie gras step 7.eps

If you want to translate blank space to hyphen, use the following command :

for file in foie*; do mv "$file" "`echo $file | tr ' ' '-'`" ; done

Replace blank space and hyphen by the characters you want.