我有一個解壓一批文件目錄中的一個簡單的bash腳本:用gunzip沒有找到文件,即使它知道文件名
#!/bin/bash
dir=/volatile/huanlab/bold/kendal/bioinformatics_database/tmp/compound
gunzip -f $dir/*gz*
然而,當我運行此命令我得到這些錯誤:
gzip: /volatile/huanlab/bold/kendal/bioinformatics_database/tmp/compound/Compound_012650001_012675000.sdf.gz: No such file or directory
gzip: /volatile/huanlab/bold/kendal/bioinformatics_database/tmp/compound/Compound_012675001_012700000.sdf.gz: No such file or directory
gzip: /volatile/huanlab/bold/kendal/bioinformatics_database/tmp/compound/Compound_012700001_012725000.sdf.gz: No such file or directory
gzip: /volatile/huanlab/bold/kendal/bioinformatics_database/tmp/compound/Compound_012725001_012750000.sdf.gz: No such file or directory
... [this continues on for every file in the directory]
很明顯,它查找目錄中的每個文件,因爲錯誤中列出了文件名,但是卻無法解壓並找不到文件。這裏發生了什麼?
編輯一些文件實際上已得到解壓縮,但該文件的錯誤仍顯示
可以通過'/ volatile/huanlab/bold/kendal/bioinformatics_database/tmp/compound/Compound_012725001_012750000.sdf.gz'鏈接嗎? – konsolebox
沒有這些是我手動放置在目錄中的所有文件。 – imkendal
注意檢查這些文件是否真的具有可讀權限? '[[-r /volatile/huanlab/bold/kendal/bioinformatics_database/tmp/compound/Compound_012700001_012725000.sdf.gz]] && echo readable' – konsolebox