Bash for循环中的多个条件以获得唯一的输出

问题描述

希望大家都好。我堆得很烂,所以需要您的帮助

我正在使用for循环来收集所有文件夹名称

for tamplate in /root/tool/nuclei-templates/*/
do 
    echo $tamplate
done

输出

/root/tool/nuclei-templates/brute-force/
/root/tool/nuclei-templates/cves/
/root/tool/nuclei-templates/dns/
/root/tool/nuclei-templates/files/
/root/tool/nuclei-templates/generic-detections/
/root/tool/nuclei-templates/panels/
/root/tool/nuclei-templates/payloads/
/root/tool/nuclei-templates/security-misconfiguration/
/root/tool/nuclei-templates/subdomain-takeover/
/root/tool/nuclei-templates/technologies/
/root/tool/nuclei-templates/tokens/
/root/tool/nuclei-templates/vulnerabilities/
/root/tool/nuclei-templates/workflows/

我在需要这些文件夹路径的工具上使用此输出。该工具也提供这样的输出

nuclei -l url.txt -t /root/tool/nuclei-templates/brute-force/ -o result.brute-force

输出

result.brute-force

但是当我使用for循环自动执行此扫描部分时,我还需要为每个结果生成唯一的输出。

我期望这样的输出

result.brute-force
reesult.cves
result.dns
result.files

通常,对于带有for循环的每个模板模板加载,它应该生成带有该模板模板文件夹名称的输出。 如果一切正常,这应该为我提供我提到的那种输出模式13个独特的结果。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...