LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > 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
  Search this Thread
Old 09-06-2005, 05:01 AM   #1
sygin
Member
 
Registered: May 2004
Posts: 36

Rep: Reputation: 15
Using 'ls' to get full path listing for mp3gain


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
 
Old 09-06-2005, 05:52 AM   #2
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
find /mnt/hda1/music -true
 
Old 09-06-2005, 07:36 AM   #3
sygin
Member
 
Registered: May 2004
Posts: 36

Original Poster
Rep: Reputation: 15
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.
 
Old 09-06-2005, 08:32 AM   #4
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
You could pipe the find output through a sed command.

Something like...

find /mnt/hda1/music -true | sed 's/ /\\ /g'
 
Old 09-06-2005, 08:55 AM   #5
sygin
Member
 
Registered: May 2004
Posts: 36

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Twitter: @linuxquestions
Open Source Consulting | Domain Registration