LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Script to Run the Same Commands on a List of Files (http://www.linuxquestions.org/questions/programming-9/script-to-run-the-same-commands-on-a-list-of-files-238125/)

Chryzmo 10-03-2004 01:20 AM

Script to Run the Same Commands on a List of Files
 
Heyas,

I want to get my DVD burner working on Linux and I found a website that tells you how to author DVDs using Linux programs. (http://mightylegends.zapto.org/dvd/dvdauthor_howto.php) I was wondering how I would go about writing a script that would take the commands I need to perform on my video files and do those commands on an entire folder of files. I have many music videos and live shows from bands that are mostly split up by song, so it would be a lot more convienent to be able to write a script that will convert the files into DVD compatible files that I could run and let it go on its own.

Thanks,
Chris

david_ross 10-03-2004 08:34 AM

You could use something like:
for file in `ls`;do somecommand arguments $file;done

This assumes that you run the command in the directory with the files, the command is "somecommand" and that $file should be changed for the real file name.


All times are GMT -5. The time now is 04:54 AM.