1
我正在使用OS X El Capitan V10.11.3。如何在Bash中創建一個循環來搜索一組.gz文件
我能夠獲得與測試文件一起使用的語法,但在一組.gz文件中使用它卻很困難。
他的工作是測試文件:
#!/bin/bash
while read p; do
grep $p test2.txt>> final.txt
done <test3.txt
我試圖寫一個循環來搜索在「test3.txt」文件中使用的SNP清單超過30 .gz文件解
#!/bin/bash
while read p; do
grep $p zcat chunk?-chr*.imputed.info.gz >> Final.txt
done <test3.txt
。
的test3.txt文件具有在.gz文件解代表1個SNP。當我運行上面的語法會創建一個文件proxy_imputed.txt,但不拉SNP。
有什麼想法?
請看看[editing-help](http://stackoverflow.com/editing-help)。 – Cyrus