So your bit of a shell script should be directing it's output into you C program as stdin, I take it?
Code:
for f in `ls`
do
echo $f
done
//so maybe something like:
for f in `ls`
do
yourCprogram <echo $f
//gives your program one filename via main(int argc, char *argv[])
//counts up the lines of data in the file
//print out the filename if it doesn't have 16 lines
done
Does this look about right? I could do it with a DOS/Windows bat file, but I've never worked with Unix.
Have you thought about what the C program should have in it, yet? If so, post up whatever you have, and kick start this thing.
This is an example of how I did it recently, in Windows, with a bat file:
Code:
@echo off
echo ****************************
echo Welcome to solver1.bat
echo Starting bb_sudoku_v05c.exe
echo ****************************
for %%a in (Q*.*) do call solver2 %%a
echo.
echo Done!
/* the above found looped through every file that began with Q
and passed the files name, to solver2.bat, which was this:
*/
echo Now processing file: %1
bb_sudoku_v06.exe -T0 -S2 -P <%1> out
echo.
echo Searching for "- Solved"
find "- Solved" out >> Gold16.txt
del /Q %1
echo %1 file has been deleted.
This was all geared for a Sudoku project, but the same
idea: Use a shell script to feed input to your C program,
(in my case bb_sudoku_v06.exe), and have it work
on every file whose name was given to it, from the < pipe.