【发布时间】:2021-08-09 13:37:59
【问题描述】:
对于 uni-assignment,我需要为 BASH-shell(在 Windows 上)编写一个 while 循环,从给定的 .txt 文件中逐行尝试不同的密码 em> 并输入它们以解压缩给定的 .zip-Archive。
我知道如何解压缩档案,我知道如何逐行回显 .txt-file 内容,但不知道如何组合它们:
#1
while read pw
do echo "$pw"
done < passwords.txt
#2
unzip -P $pw archive.zip
【问题讨论】:
-
那么什么是硬的?将
unzip替换为echo
标签: bash while-loop command-line git-bash unzip