954,180 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Basic scripting question

So I'm really new but I have written a simple bash shell script filter (using someone elses conversion utility) to insert a copyright text line into a MIDI file. The script works fine on the first file in the directory, however the whole point of writing this script for me is to batch whole directories of these files. Is there a standard way of telling such a script to proceed to the next file that fits the same critera (being = *.MID). while not endlessly batching that directory over and over. Also important is the ability to use it on a variety of file names.
I apologize if this is in the wrong place but I figure it's a pretty newbie question.

jkristos
Newbie Poster
8 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

you could do that REALLY quickly:

cd mydir/
for i in *.mid : do 
     myfile.sh
done


I think that's right-- just do a little for loop can handle that nicely. You'll want to check my syntax-- I think it's right, though.

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: