use*_*862 4 shell shell-script
我的 shell 脚本如下所示:
#!/bin/bash
for file in *.fasta
do
signalp $file > $file.txt
done
Run Code Online (Sandbox Code Playgroud)
在工作文件夹中,我有 18.000 个 .fasta 文件。我想通过signalp程序运行每个。我猜它文件夹中的文件太多,但我不知道如何调整我的代码。有什么帮助吗?
您可以使用find
:
find . -maxdepth 1 -type f -exec sh -c 'signalp "$1" >"$1".txt' _ {} \;
Run Code Online (Sandbox Code Playgroud)
-maxdepth 1
将仅在当前目录中find
搜索文件 ( -type f
)
sh -c 'signalp "$1" >"$1".txt'
将对signalp
找到的所有文件执行该命令,并将输出保存到添加.txt
到原始文件名后命名的文件中。
归档时间: |
|
查看次数: |
3229 次 |
最近记录: |