944,079 Members | Top Members by Rank

Ad:
Aug 28th, 2005
0

Basic scripting question

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jkristos is offline Offline
8 posts
since Aug 2005
Sep 3rd, 2005
0

Re: Basic scripting question

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.
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Getting Started and Choosing a Distro Forum Timeline: Problem with installing Linux Fedora Core 2!??
Next Thread in Getting Started and Choosing a Distro Forum Timeline: Linspire Review





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC