Bash找不到文件

Bash找不到文件,bash,file-access,debian-stretch,Bash,File Access,Debian Stretch,我正在Azure上的串行控制台上以VM的形式运行Debian9 链接到示例输入文件: antiSMASH的帮助人员给了我一些代码。它应该遍历文件夹中的genbank文件,并使用antiSMASH包处理它们: for infile in inputs/*.gbk; do antismash $infile --taxon fungi --input-type nucl --knownclusterblast done 我在包含文件的目录下尝试运行它,在包含文件夹“inputs”(包含.

我正在Azure上的串行控制台上以VM的形式运行Debian9

链接到示例输入文件:

antiSMASH的帮助人员给了我一些代码。它应该遍历文件夹中的genbank文件,并使用antiSMASH包处理它们:

for infile in inputs/*.gbk; do
    antismash $infile --taxon fungi --input-type nucl --knownclusterblast
done
我在包含文件的目录下尝试运行它,在包含文件夹“inputs”(包含.gb文件)的目录下尝试运行它:

(antismash) macpat@Debian9:~/inputs$ for infile in inputs/*.gb; do
> antismash $infile --taxon fungi --input-type nucl --knownclusterblast
> done
ERROR   25/05 21:53:00   No sequence file found at 'inputs/*.gb'
我运行了以下命令:

(antismash) macpat@Debian9:~$ for infile in ~/inputs/*.gb; do echo $infile; done
/home/macpat/inputs/DQ660910.gb
/home/macpat/inputs/EU872212.gb
/home/macpat/inputs/GU930713.gb
/home/macpat/inputs/GU930714.gb
/home/macpat/inputs/HM180407.gb
/home/macpat/inputs/HM180409.gb
/home/macpat/inputs/HQ823618.gb
/home/macpat/inputs/HQ823619.gb
/home/macpat/inputs/HQ823620.gb
/home/macpat/inputs/HQ823621.gb
/home/macpat/inputs/JN408682.gb
/home/macpat/inputs/JQ340775.gb
/home/macpat/inputs/JX067626.gb
/home/macpat/inputs/JX067627.gb
/home/macpat/inputs/JX232185.gb
/home/macpat/inputs/JX232186.gb
/home/macpat/inputs/JX232187.gb
/home/macpat/inputs/JX232188.gb
/home/macpat/inputs/KJ501919.gb
/home/macpat/inputs/MG777489.gb
/home/macpat/inputs/MG777490.gb
/home/macpat/inputs/MG777491.gb
/home/macpat/inputs/MG777492.gb
/home/macpat/inputs/MG777493.gb
/home/macpat/inputs/MG777494.gb
/home/macpat/inputs/MG777495.gb
/home/macpat/inputs/MG777496.gb
/home/macpat/inputs/MG777497.gb
/home/macpat/inputs/MG777498.gb
/home/macpat/inputs/MG777499.gb
/home/macpat/inputs/MG777500.gb
/home/macpat/inputs/MG777501.gb
/home/macpat/inputs/MG777502.gb
这是antiSMASH人发送给我的电子邮件:

亲爱的反mash用户:

为了在许多输入文件上运行antiSMASH,我通常在 bash,就像这样:

for infile in inputs/*.gbk; do
    antismash $infile --your --other-options --here done
假设您的输入文件为GenBank格式,并且位于 当前目录名为“input”的子目录,antiSMASH将 按顺序运行所有输入文件。我知道你要的是“全部” 一次”,但反mash拥有相当不错的CPU和内存 要求,特别是在运行ClusterBlast时,我不会 建议

向你问好,凯


在失败的情况下,您编写了
输入/*.gb
。在使用echo的工作目录中,您编写的
~/inputs/*.gb
inputs/
是一个相对路径,这意味着您必须位于其父目录
/home/macpat
中,它才能工作。要移动到
/home/macpat
,您可以运行
cd

cd
for infile in inputs/*.gb; do ...
另一方面,
~/inputs/
是一条绝对路径,这意味着它可以在任何地方工作

for infile in ~/inputs/*.gb; do ...
或者,如果要从
~/inputs/
中运行脚本,可以运行以下命令:

cd ~/inputs
for infile in *.gb; do ...

看起来您已经在目录
inputs
,因此您必须使用相对路径
/*.gbk
,而不是
inputs/*.gbk
。另外,您应该引用
“$infle”
,这样文件名中的空格和全局字符就没有任何效果。您似乎还混淆了
.gb
.gbk
,请确保使用正确的。您可以使用
ls inputs/*.gb
重现问题,所以antiSMASH和您的os/平台是不相关的。我也从上面的一个目录中尝试过。我尝试了.gbk,然后尝试了.gb。我还没有尝试过“$infle”上的引号,我会试一试。wjandrea,你是说用ls代替infle是同义词吗?