Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

process a group of files

Posted on 1998-06-10
2
Medium Priority
?
237 Views
Last Modified: 2012-05-04
Hello,
I have an executable program can only read one file one time and process it and write output to a new created file.
How can I invoke it one time to process all the files in current directory .

actually I would like to do something like this: " processing_program  *  "

Thanks
0
Comment
Question by:tian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:tian
ID: 2007862
Edited text of question
0
 
LVL 1

Accepted Solution

by:
zonker031798 earned 200 total points
ID: 2007863
You can write a shell script which iterates through each
file in the current directory, invoking your executable program
on each one.

Let's say that your executable program is called "ep".  Then
in the csh, you could do this:

foreach i (*)
      ep  < $i > $i.output
end

Or in the Bourne shell, you could do this:

for i in *
do
      ep < $i > $i.output
done

If you'd like to monitor the progress of your script as it
runs the program on each file, then add an "echo" statement
inside the loop along the lines of:

      echo "ep now working on $i"


0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question