Re: bulk rename pod1 > pod2 needed

Top Page
Attachments:
Message as email
+ (text/plain)
+ PGP.sig (application/pgp-signature)
+ (text/plain)
Delete this message
Reply to this message
Author: Alex Dean
Date:  
To: Main PLUG discussion list
Subject: Re: bulk rename pod1 > pod2 needed

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
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss