I'm trying to convert a cshell script into a bash one. To compile some files in different subdirectories, it uses foreach
cd $BLDSRCDIR
foreach file ( $flist )
$myCC -c $myCFLAGS $file.c -o $BLDDIR/$file.o
end for
Because bash doesn't have foreach, I tried:
for file [ $flist ] in
do
$myCC -c $myCFLAGS $file.c -o $BLDDIR/$file.o
done
But this syntax is not correct ( syntax error near unexpected token [' ). There is probably more than one solution but I was wondering about a concise way to loop through (and compile) all files in the different subdirectories.