我有以下几点:
#!/bin/bash a=0 for d in ./*/ ; do ( cd "$d" ((a++)) echo $a ); done
它进入我路径中的每个目录,递增a并打印a。但是,输出始终为 1。这是为什么呢?
a
bash
bash ×1