bulk rename pod1 > pod2 needed

Alex Dean alex at crackpot.org
Tue Feb 17 12:47:08 MST 2009


On Feb 17, 2009, at 11:38 AM, Dennis Kibbe wrote:

>> Actually, if the original specification is co=
>> rrect, probably none of the solutions proposed is likely to  
>> work.  It =
>> appears that the target name for the first rename is the same as  
>> the source=
>> for the second.  If this were true one would have to ensure  
>> that rena=
>> me or move operations were done in an order to avoid attempts to  
>> overwrite =
>> existing names.
>
> That's correct. So renaming needs to start at the end. (There are  
> actually 24 files in the directory.)
>
> so renaming:
>
> ccna.pod24.pc1.ext to ccna.pod25.pc1.ext
>
> needs to happen before renaming:
>
> ccna.pod23.pc1.ext to ccna.pod24.pc1.ext
>
> and so on down to:
>
> ccna.pod1.pc1.ext to ccna.pod2.pc1.ext

Could you perhaps keep the original files in some other naming  
convention, and create symlinks in the ccna.podXX.pc1.ext format?  It  
might be easier to write a script, then, to :
  - remove all old symlinks
  - sort the original files by descending mtime
  - create new symlinks sequentially, 1-24.

This eliminates the need to parse the existing file names to figure  
out which sequence number they have.

Just a thought.

alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20090217/7f276bae/attachment.pgp 


More information about the PLUG-discuss mailing list