Removing spaces within Filename

Hello,

I have a Folder (myfile) which contain the following files:

P$12789865KR +N+01+OM+16102009165416.nu
P$M1-508962GD +N+01+ALP+14102009094417.nu

Is there a sed command(s) that will loop through this folder
and remove the spaces that exists in the filename?

Any help would be greatly appreciated.

bash

for i in *nu; do echo mv "'$i'" ${i// /}; done

How about rename ?

rename 's/ //' *
ls -1| while read LINE; do mv "$LINE" `echo "$LINE"| sed 's/ //g'`; done

Thank you friends for your speedy replies,

Unfotunately i have pasted your code into a .bat file and it still doesn't work!

A .bat file? Are you in windows? This is a UNIX forum. There is a section for Windows users but this isn't it.

I cannot understand what you mean by .bat file.

Anyway if that is a batch job, you need to give the absolute path of rename

/usr/bin/rename 's/ //' <PATH-TO-RENAME>/*

If this is unix, the dollar sign in the filename is awkward. Let's find out the environment.