Re: [SLUG] mass renaming?

From: Eben King (eben1@tampabay.rr.com)
Date: Wed Oct 13 2004 - 17:33:48 EDT


On Wed, 13 Oct 2004, Austin Theen wrote:

> I need a quick bash / prel script to rename incomming faxes to a larger
> range.
>
> for instance.
> > -rw-r--r-- 1 uucp uucp 28049 Sep 13 11:43 fax01267.tif
> > -rw-r--r-- 1 uucp uucp 31057 Sep 13 16:28 fax01268.tif
> > -rw-r--r-- 1 uucp uucp 456457 Sep 13 18:08 fax01269.tif
>
> needs to be renamed (without changing the numbers) to this format
>
> > -rw-r--r-- 1 uucp uucp 228605 Sep 20 15:19 fax000001274.tif
> > -rw-r--r-- 1 uucp uucp 86629 Sep 21 08:32 fax000001275.tif
> > -rw-r--r-- 1 uucp uucp 47145 Sep 21 09:15 fax000001276.tif
> > -rw-r--r-- 1 uucp uucp 61035 Sep 21 10:19 fax000001277.tif
> ^^^^
> So essentially, I need to add '0000' after fax*.tif.
>
> Anyone crafty enough to come up with a quick solution?

rename x x0000 fax?????.tif
from --^ ^-to^ ^-victims--^

Try it on one file first in case this is wrong.

I suppose you could do a 'for' loop over all files, and have a 'sed'
inside, but this is much easier and faster.

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar
                  "God does not play dice" -- Einstein
          "Not only does God play dice, he sometimes throws
          them where they can't be seen." -- Stephen Hawking

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:41:09 EDT