SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207
Rep:
scripting with lame
I have ~ 150 mp3 files that are not sequentially named that I would like lame to re-encode with lame. The lame command I figured out. I don't want to apply lame by hand 150 times. I figure the easiest way to do this is with a simple script that increments from 1 to 150 and executes 2 commands...a find command piped into the lame command. How could I set this up?
Use a for loop or find and pipe to xargs rename... Somethin'... I don't have a linux box handy so I'm not going to write you anything without being able to test it.... Sorry. Try a rename .mp3 to _24 and a rename new to mp3
The original script should have been written to take care of everything in one fell swoop for a trouble free re-encode.
Well, technically, 'xargs' works better. (I just don't tend to use it as much because it doesn't always do what I tell it to, or I just don't understand it well).
For that second script to work on multiple directories it would have to be:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.