Monday, May 01, 2006

Unix : Find a list of files and compile them

Very easy way to find a list of files in a directory and compile them all via a shell script without having to manually find and compile each one:

for i in $(ls *.c); do

compile $i

done

This looks for a list of C files and then compiles them. You need to substitute the actual name of your compiler for the "compile" part of the script.

Enjoy!

No comments: