方案一
for i in $(seq 1 100)
do
echo $(expr $i \* 3 + 1);
done
方案二
for i in {1..100}
do
echo $(expr $i \* 3 + 1);
done
方案三
list="where are you from"
for i in $list;
do
echo "$i is ok";
done
方案四
for i in f1 f2 f3 ;
do
echo $i is ok ;
done
方案五
for file in /var/*;
do
echo $file is file path \! ;
done
或
for file in $(ls *.gz);
do
gunzip -c $file > ${file%%.*} ;
done