#!/bin/bash
echo "for: Traditional form: for var in ..."
for j in $(seq 1 5)
do
let "name1 = j"
echo "$j" | awk '{printf("%05d\n",$1)}'
echo "$j 1" | awk '{printf("%05d\n",$1+$2)}'
echo "..."
done
输出:
for: Traditional form: for var in ...
00001
00002
...
00002
00003
...
00003
00004
...
00004
00005
...
00005
00006
...
##########################################################
可执行命令的循环:
for j in $(seq 1 9) do a=$j b=$[$j+1] c=$j aa=`printf "%05d.jpg" $a` bb=`printf "%05d.jpg" $b` cc=`printf "out%05d.flo" $c` echo $aa echo $bb ./run_OF_INT $aa $bb $cc 5 3 12 12 0.05 0.95 0 8 0.40 0 1 0 1 10 10 5 1 3 1.6 2 done