Reply

Join Date: Aug 2005
Posts: 8
Reputation: jkristos is an unknown quantity at this point 
Solved Threads: 0
jkristos jkristos is offline Offline
Newbie Poster

Basic scripting question

 
0
  #1
Aug 28th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Basic scripting question

 
0
  #2
Sep 3rd, 2005
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.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Getting Started and Choosing a Distro Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC