LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 09-06-2005, 06: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, 06: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, 08: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 09:00 AM.
 
Old 09-06-2005, 09: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, 09: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 09: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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 04:03 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration