如何解决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 举报,一经查实,本站将立刻删除。