#!/bin/bash
# Rename files to remove spaces
# Arguments:
#   $1 : file name to change
# Best used with 'find' to rename all files in a tree.
# Sample command:
#    find . -print -exec radiojove-rename.sh {} \;
orig=$1
step1=${orig// - /-}
step2=${step1// /-}
step3=${step2//--/-}
dest=${step3//-\./.}
if [ "$orig" != "$dest" ]; then # Change name
   echo mv $orig $dest
   mv "$orig" "$dest"
fi
