Linux C式for

Linux C式for
bash支持C式的for语句
for((varialbe assignment; condition; iteration process))
该句中有几项不遵守标准bash shell的for方法
1、变量的赋值可以包含空格
2、条件中的变量不以$开始
3、迭代处理式不用使用expr

eg

for(( i=1; i<=10; i++ ))
do
  echo "The next number is $i"
done

你可能感兴趣的:(Linux C式for)