#! /bin/bash
for i in `seq -w 100 419`
do
mkdir $i
cd $i
touch ${i}_0.bmp
touch ${i}_1.bmp
touch ${i}_2.bmp
touch ${i}_3.bmp
touch ${i}_4.bmp
cd ..
done
跟bash解析和展开的顺序有关系。
The order of expansions is: brace expansion, tilde expansion, parameter, variable and arithmetic expansion and command ubstitution (done in a left-to-right fashion), word splitting, and pathname expansion.
先做{}展开,然后再进行参数替换。