LinuxQuestions.org
Help answer threads with 0 replies.
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, 04:52 AM   #1
BuckRogers01
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 232

Rep: Reputation: 30
Bash script to process every file in current dir and sub dirs


Hi, does anyone know of a script that will do 'function, or whatever I want', to every file in the current dir and sub dirs. This is because I am writing a script which rearranges my music library depending on the IDv3 tags of my MP3 files, I just need a script that repeates and gives the filename of every file in the current dir and sub dirs, so that I can read the IDv3 tags of each file to process them

Any info would be great, Buck
 
Old 09-06-2005, 05:16 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
The basic command for that is:
Code:
find ./ -type f -exec function '{}' \;
where {} gets replaced with each found file in turn.

Yves.
 
Old 09-06-2005, 07:31 AM   #3
Riddick
Member
 
Registered: May 2004
Location: Rome, Italy
Distribution: slackware-current
Posts: 454

Rep: Reputation: 30
or surely just a clever usage of "*", no?
like:

Code:
function *
will perform the function for everything in the folder you're in...

This may be bad practice though
 
Old 09-06-2005, 07:32 AM   #4
Riddick
Member
 
Registered: May 2004
Location: Rome, Italy
Distribution: slackware-current
Posts: 454

Rep: Reputation: 30
Download and install the graphical tool:
"EasyTAG"
It is amazing at doing batch jobs... it sorted out
all of my music!

-Riddick again
 
  


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
Bash Script test for empty dir uopjohnson Linux - Software 3 10-07-2005 06:45 PM
Bash script to compare dir contents Boffy Programming 2 08-02-2005 06:08 AM
-bash no such file or dir slackwarefan Slackware 3 06-12-2004 07:49 AM
Bash script (untar *.tar files and then cd to the untared dir) k0ljat Linux - Newbie 2 12-30-2003 05:57 AM
bash script to rm all files in a dir keirobyn Programming 8 07-19-2002 07:53 AM


All times are GMT -5. The time now is 03:47 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 Google+: linuxquestions
Open Source Consulting | Domain Registration