Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-06-2005, 05:03 PM   #1
LQ Newbie
Registered: Jun 2005
Distribution: ubuntu - hoary hedgehog
Posts: 13

Rep: Reputation: 0
Bash Programming, Recursive/Iterative Calls on Folder Contents

Here is the issue - im trying to code a script that checks my mp3 tags and sorts them into a folder accordingly.
I got a title called mp3info and use it in conjunction with my code:
Here is what i have:

cd "$ROOT"
echo Current Folder is $ROOT, what subfolder do you want to sort?
read SBFLDR #torrents/complete/Semisonic - All About Chemistry

cd "$SBFLDR"

mp3info -p %a *.mp3 | artistmakefolder
#cp * "$ROOT/Music/$SBFL"

artistmakefolder takes the output of mp3info -p %a (which gets the artist name) and creates a folder based on the name.

My issue is that since it isn't recursive or iterative, my folder names are:
WilcoWilcoWilcoWilcoWilco - how ever many mp3s i have in my folder since i specified *.mp3.

Is there a way to go through and say.. for(mp3listed first in ls output)until(mp3listed last in ls output) pipe artist name into my program artistmakefolder.

I guess that is the real qustion - god i did not explain it well....
Old 07-06-2005, 06:44 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
I don't know the inner workings of mp3info or artistmakefolder, but
maybe this will get you somewhere..
mp3info -p %a *.mp3 | xargs -i artistmakefolder {}



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
C programming pointers & recursive exvor Programming 8 08-16-2005 09:24 AM
Help with a recursive chmod script in bash lowpro2k3 Programming 11 07-25-2005 07:03 PM
Samba - XP can't list folder contents p0tw0r Linux - Networking 1 05-31-2005 03:37 AM
Cannot see contents of my folder nr4g3d Linux - Newbie 6 02-09-2004 03:01 PM
samba does not show folder contents Goma_2 Linux - Networking 0 12-10-2003 04:54 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:59 PM.

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