LinuxQuestions.org
Have you heard the LinuxQuestions.org Podcast?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
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

Reply
 
Thread Tools
Old 09-06-2005, 05:01 AM   #1
sygin
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
sygin is offline     Reply With Quote
Old 09-06-2005, 05:52 AM   #2
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 506
Thanked: 0
find /mnt/hda1/music -true
jkobrien is offline     Reply With Quote
Old 09-06-2005, 07:36 AM   #3
sygin
Member
 
Registered: May 2004
Posts: 36
Thanked: 0

Original Poster
Smile 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 08:00 AM..
sygin is offline     Reply With Quote
Old 09-06-2005, 08:32 AM   #4
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 506
Thanked: 0
You could pipe the find output through a sed command.

Something like...

find /mnt/hda1/music -true | sed 's/ /\\ /g'
jkobrien is offline     Reply With Quote
Old 09-06-2005, 08:55 AM   #5
sygin
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 08:58 AM..
sygin is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
full path of a file ttilt Linux - General 1 11-08-2005 06:02 PM
shell scripting full directory listing sqn Programming 4 04-13-2005 04:33 PM
recursively listing directories full paths kubicon Linux - Newbie 2 02-22-2004 03:55 PM
get full path of a command (in C) Hady Linux - Software 1 11-19-2003 05:46 PM
Full Path problems chedmaster Linux - Newbie 1 06-26-2003 10:24 AM


All times are GMT -5. The time now is 11:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration