Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-03-2004, 02:20 AM   #1
Registered: Jun 2003
Location: Virginia
Distribution: Slackware 10.1
Posts: 180

Rep: Reputation: 30
Script to Run the Same Commands on a List of Files


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. ( 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.

Old 10-03-2004, 09:34 AM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
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.


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
Help to create a script to open a terminal and run commands in it. Brian1 Linux - Software 6 02-07-2005 07:46 PM
run script on multiple files statmobile Programming 6 07-17-2004 12:35 AM
Creating a script to run two commands anjaan Programming 11 06-15-2004 03:51 AM
Script files and global commands... LinuxBAH Linux - Software 6 06-25-2003 01:38 AM
run 2 commands in a script ddpicard Linux - General 10 06-13-2003 05:50 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration