Re removing hyphens from filenames

Abigail abigail at abigail.be
Thu Jul 12 13:28:52 BST 2007


On Thu, Jul 12, 2007 at 01:10:16PM +0100, Matt Wilson wrote:
> On 7/12/07, Abigail <abigail at abigail.be> wrote:
> >for f in `find . -name '*-*'`; do mv $f `echo $f | tr -d -`; done
> 
> I generally avoid the use of `for' in operations such as this - you
> never know when people have created files with spaces in the name.


In that case:

IFS=
for f in `find . -name '*-*'`; do mv $f `echo $f | tr -d -`; done


Abigail


More information about the london.pm mailing list