Which of the following examples shows the general structure of a for loop in a shell script?
A. for *.txt as file => echo $file
B. for *.txt ( echo $i )
C. for file in *.txt do echo $i done
D. for ls *.txt exec {} ;
E. foreach @{file} { echo $i
}
The answer is A.
https://learning.lpi.org/
3.3 Lição 2 – Loops for
for file in $FILES
do
ls -lh $file
done