Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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 .
09-06-2005, 06:01 AM
#1
Member
Registered: May 2004
Posts: 36
Thanked: 0
Using 'ls' to get full path listing for mp3gain
[
Log in to
get rid of this advertisement]
Hi,
I am trying to get mp3gain to process all my mp3 files which are in various directories in /mnt/hda1/music
I want to use somthing like:
mp3gain -k -T -p `ls -R /mnt/hda1/music`
I am looking for a way to get a full path listing of every file including sub directories.
if I use:
ls -R /mnt/hda1/music
I get:
/mnt/hda1/music/u2/The Joshua Tree:
U2 - Bullet The Blue Sky.mp3
U2 - Exit.mp3
U2 - In God's Country.mp3
I need:
/mnt/hda1/music/u2/The Joshua Tree/U2 - Bullet The Blue Sky.mp3
/mnt/hda1/music/u2/The Joshua Tree/U2 - Exit.mp3
/mnt/hda1/music/u2/The Joshua Tree/U2 - In God's Country.mp3
....etc
I may need to use a script of some sort.
If you have any suggestions please respond.
Thanks
Sygin
09-06-2005, 06:52 AM
#2
Member
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507
Thanked: 0
find /mnt/hda1/music -true
09-06-2005, 08:36 AM
#3
Member
Registered: May 2004
Posts: 36
Thanked: 0
Original Poster
Thanks - Almost Solved
Thanks jkobrien,
Your suggestion almost works.
I now use:
mp3gain -k -T -p `find /mnt/hda1/music/*.mp3 -true`
The problem is that the spaces in the filenames confuse mp3gain.
Is there a way to wrap the filenames in quotes " or ' ?
Thanks
Sygin
Last edited by sygin; 09-06-2005 at 09:00 AM ..
09-06-2005, 09:32 AM
#4
Member
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507
Thanked: 0
You could pipe the find output through a sed command.
Something like...
find /mnt/hda1/music -true | sed 's/ /\\ /g'
09-06-2005, 09:55 AM
#5
Member
Registered: May 2004
Posts: 36
Thanked: 0
Original Poster
Problem Solved
Hi People,
After studing the manual for 'find'
The problem is solved.
I now use:
find /mnt/hda1/music -exec mp3gain -p -k -T '{}' \;
This runs:
mp3gain -p -k -T
On every file found in the /mnt/hda1/music directory including all subdirectories (recursivly).
Thanks jkobrien
You rock!
Sygin
Last edited by sygin; 09-06-2005 at 09:58 AM ..
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 03:48 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News
LQ Podcast
LQ Radio