shell中for循环总结

最常用的就是遍历操作某一类文件,比如批量建索引。

for i in `ls`
do
        samtools faidx $i
done

注意:for末尾不需要冒号(:),循环的代码块是由do和done来,反引号用来捕获输出,记住shell创建变量时不用\$,而使用变量时则需要加\$。

相关文章:

  • 2021-09-25
  • 2022-01-15
  • 2021-08-30
  • 2022-12-23
猜你喜欢
  • 2021-08-08
  • 2022-12-23
  • 2021-11-20
  • 2021-10-31
相关资源
相似解决方案