Re: Stupid spaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How about:

 for x in *; do mv $x ${x// /_}; done 

On Thu, 12 Feb 2004, Scott Taylor wrote:

> Date: Thu, 12 Feb 2004 13:08:04 -0800
> From: Scott Taylor <scott@xxxxxxxxxxxxxxx>
> To: linux-admin@xxxxxxxxxxxxxxx
> Subject: Stupid spaces
> 
> Hello all,
> 
> I've done this before, but so long ago I can't find it again.  I have a 
> bunch of files with spaces in them and I want to rename them with the 
> spaces removed.
> 
> I have a rename command that came with RH7.2 but doesn't do the job
> rename 's/\ //g' *
> does nothing in bash
> 
> So I wrote a script many moons ago to do this but I can't remember which 
> server it was on, let alone how I did it.  Something with tr and mv methinks.
> 
> anyone?
> 
> -
> : send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux