#!/bin/bash
#### spaceconvert donated by Edge-Op - running this script in a directory with 
#### files with spaces in their names will rename each file into a file with 
#### all spaces removed. 
#### chmod 755 spaceconvert && cp spaceconvert /home/bluelein/files2rename/ && cd /home/bluelein/files2rename/ && ./spaceconvert
#### will rename ALL files like: AK!1200 MC Navigator Drowning.mp3 into AK1200_MC_Navigator_Drowning.mp3
#### WARNING - dont run this script in a folder containing ANY files wher e you do NOT want names renamed... !!!
#### Peace out - lam0idz
for n in *
do
   echo ${n}
   x=${n//\ /\_}
   echo ${x}
  if [ -f "$n" ]
      then
        echo $n $x
        mv "${n}" "${x}"   
  fi
done












