for file hi in $src1 $src2
do
echo here are $file $hi
done
------解决方案-------------------- 1 #!/bin/bash
2
3 src1=/home/ubuntu/quinton/search/test1
4 src2=/home/ubuntu/quinton/search/test2
5
6 for file in $src1; do
7
8 echo here are $file
9 done
10 for hi in $src2; do
11
12 echo here are $hi
13 done
$ cd /tmp
$ mkdir test{1..2}
$ touch test1/file{1..10}
$ touch test2/hi{1..10}
$ for file in test1/*;do echo here are $file `echo $file ------解决方案-------------------- sed 's/test1/test2/g;s/file/hi/g'`;done
here are test1/file1 test2/hi1
here are test1/file10 test2/hi10
here are test1/file2 test2/hi2
here are test1/file3 test2/hi3
here are test1/file4 test2/hi4
here are test1/file5 test2/hi5
here are test1/file6 test2/hi6
here are test1/file7 test2/hi7
here are test1/file8 test2/hi8
here are test1/file9 test2/hi9