linux系统中while循环一次传入多个变量
2021/8/7 7:06:27
本文主要是介绍linux系统中while循环一次传入多个变量,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1、测试数据
[root@centos79 test]# cat reads.list sample01 /home/test/sample01 /home/test/sample01_2.fq.gz sample02 /home/test/sample02 /home/test/sample02_2.fq.gz sample03 /home/test/sample03 /home/test/sample03_2.fq.gz sample04 /home/test/sample04 /home/test/sample04_2.fq.gz sample05 /home/test/sample05 /home/test/sample05_2.fq.gz sample06 /home/test/sample06 /home/test/sample06_2.fq.gz sample07 /home/test/sample07 /home/test/sample07_2.fq.gz sample08 /home/test/sample08 /home/test/sample08_2.fq.gz sample09 /home/test/sample09 /home/test/sample09_2.fq.gz sample10 /home/test/sample10 /home/test/sample10_2.fq.gz
2、while 一次传入多个变量
[root@centos79 test]# cat reads.list sample01 /home/test/sample01 /home/test/sample01_2.fq.gz sample02 /home/test/sample02 /home/test/sample02_2.fq.gz sample03 /home/test/sample03 /home/test/sample03_2.fq.gz sample04 /home/test/sample04 /home/test/sample04_2.fq.gz sample05 /home/test/sample05 /home/test/sample05_2.fq.gz sample06 /home/test/sample06 /home/test/sample06_2.fq.gz sample07 /home/test/sample07 /home/test/sample07_2.fq.gz sample08 /home/test/sample08 /home/test/sample08_2.fq.gz sample09 /home/test/sample09 /home/test/sample09_2.fq.gz sample10 /home/test/sample10 /home/test/sample10_2.fq.gz [root@centos79 test]# cat reads.list | while read {i,j,k};do echo "mkdir $i; fastqc -o $i -f fastq $j $k";done; mkdir sample01; fastqc -o sample01 -f fastq /home/test/sample01 /home/test/sample01_2.fq.gz mkdir sample02; fastqc -o sample02 -f fastq /home/test/sample02 /home/test/sample02_2.fq.gz mkdir sample03; fastqc -o sample03 -f fastq /home/test/sample03 /home/test/sample03_2.fq.gz mkdir sample04; fastqc -o sample04 -f fastq /home/test/sample04 /home/test/sample04_2.fq.gz mkdir sample05; fastqc -o sample05 -f fastq /home/test/sample05 /home/test/sample05_2.fq.gz mkdir sample06; fastqc -o sample06 -f fastq /home/test/sample06 /home/test/sample06_2.fq.gz mkdir sample07; fastqc -o sample07 -f fastq /home/test/sample07 /home/test/sample07_2.fq.gz mkdir sample08; fastqc -o sample08 -f fastq /home/test/sample08 /home/test/sample08_2.fq.gz mkdir sample09; fastqc -o sample09 -f fastq /home/test/sample09 /home/test/sample09_2.fq.gz mkdir sample10; fastqc -o sample10 -f fastq /home/test/sample10 /home/test/sample10_2.fq.gz
参考:https://mp.weixin.qq.com/s?__biz=MzI2MjA1MDQxMg==&mid=2649713997&idx=1&sn=c44d0375f869ad52067cf9ddbaf9ba8f&chksm=f24aca4ec53d43589d1bf9722e9cd7e2d749000fdfd5848ad7eb8b52da7cab1a166aa95483d0&mpshare=1&scene=23&srcid=0805NyC2GHHYp9ri9GexKAG4&sharer_sharetime=1628156129675&sharer_shareid=4ed060cc4cd1efce40e3ab6dd8d8c7d4#rd
这篇关于linux系统中while循环一次传入多个变量的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-12如何创建可引导的 ESXi USB 安装介质 (macOS, Linux, Windows)
- 2024-11-08linux的 vi编辑器中搜索关键字有哪些常用的命令和技巧?-icode9专业技术文章分享
- 2024-11-08在 Linux 的 vi 或 vim 编辑器中什么命令可以直接跳到文件的结尾?-icode9专业技术文章分享
- 2024-10-22原生鸿蒙操作系统HarmonyOS NEXT(HarmonyOS 5)正式发布
- 2024-10-18操作系统入门教程:新手必看的基本操作指南
- 2024-10-18初学者必看:操作系统入门全攻略
- 2024-10-17操作系统入门教程:轻松掌握操作系统基础知识
- 2024-09-11Linux部署Scrapy学习:入门级指南
- 2024-09-11Linux部署Scrapy:入门级指南
- 2024-08-21【Linux】分区向左扩容的方法