脚本如下:

#!/bin/bash

cd /tmp/

mkdir shell_tut
cd shell_tut
for ((i=0; i<10; i++)); do
   touch test_$i.txt
done

执行结果:

shell脚本依序创建10个文本

 

相关文章: