Re: [Help] Renaming files through bash shell scripts
Baskar Selvaraj <baskar-FaTCxNPFk8w/[email protected]>
| Newsgroups | gmane.org.user-groups.linux.ilugc |
|---|---|
| Message-ID | <CACtiFJb5_SCKLmd2ftcrEJtQAB0AUdipNfsPCdm_ox8emFk6eg@mail.gmail.com> |
On Wed, Oct 28, 2015 at 3:03 PM, Shakthi Kannan <[email protected]> wrote: > Hi, > > --- On Wed, Oct 28, 2015 at 2:55 PM, Baskar Selvaraj > <baskar-FaTCxNPFk8w/[email protected]> wrote: > | The scripts works, but the results were different, if the value > after L is < 10. > \-- > > That is the question I had asked in my previous reply. What should be > the expected behavior in such a case? There could be 'n' number of modules (referred as M) and those modules may have 'n' no.of number of lectures (referred as L). Now the requirement is to remove the modules from the filenames and have only lectures in consecutive numerical order If the directory has files names like this, M1L1.mp4 M1L2.mp4 M1L3.mp4 M2L1.mp4 M2L2.mp4 M2L3.mp4 M2L4.mp4 M3L1.mp4 M3L2.mp4 Then, the resulting file list should be as below (were M followed by 'n' value can be removed) L1.mp4 L2.mp4 L3.mp4 L4.mp4 (here M2L1 should automatically get renamed to L4) L5.mp4 L6.mp4 L7.mp4 L8.mp4 (here M3L1 again should automatically get renamed to L8) L9.mp4 S. Baskar _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc ILUGC Mailing List Guidelines: http://ilugc.in/mailinglist-guidelines