日期:2014-05-16 浏览次数:20623 次
declare -i width=100
for w in {1..$width}
do
echo $w
done
[: {1..100}: integer expression expected
#!/bin/bash
START=1
END=100
for ((i=$START;i<=$END;i++)); do
echo $i
done
#!/bin/bash
START=1
END=100
for i in $(eval echo "{$START..$END}"); do
echo "$i"
done