linux - 这是 7z 9.20 for linux 中的错误(密码中的 $ 字符)吗?

标签 linux shell passwords 7zip

i686-pc-linux-gnu 上的 7-Zip 9.20

  1. 创建存档

/usr/syno/bin/7z a "/volume1/test.7z" "/volume1/file.txt" -xr!thumbs.db -xr!@eaDir -xr!@tmp -xr!#recycle -xr!lost+found -xr!.DS_Store -t7z -ms=off -mhe -mmt -mx0 -v10m -p"pa$ss$12"

  1. 现在尝试使用相同的密码从 Windows (7-Zip File Manager 16.04) 中的存档“test.7z”中提取文件“file.txt”

  2. 在我的例子中,密码总是不正确:(((

最佳答案

$ 被 shell 解释为一个变量。您需要使用单引号而不是双引号

/usr/syno/bin/7z a "/volume1/test.7z" "/volume1/file.txt" -xr!thumbs.db -xr!@eaDir -xr!@tmp -xr!#recycle -xr!lost+found -xr!.DS_Store -t7z -ms=off -mhe -mmt -mx0 -v10m -p'pa$ss$12'

关于linux - 这是 7z 9.20 for linux 中的错误(密码中的 $ 字符)吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42721793/

相关文章:

bash - 在crontab中调用时,带有hive命令的shell脚本未将数据写入文件

linux - 如何将目录添加到 $PATH 但前提是它不存在

php - 如何创建带有重定向的简单密码表单/脚本? (还需要一点点安全性)

Python Fabric 从单独的文件加载配置

linux - 使 : g: No such file or directory make: *** No rule to make target `g' . 停止

python-3.x - 如何选择和使用 python3 dbus 库来替换 dbus-send 调用

linux - 如何使用 sed 将文本替换为 ":"

linux - mkdir 中的详细选项是什么?

security - 我的 friend 使用 SHA512 算法对密码进行哈希处理,不加盐。我如何说服他需要加盐?

c++ - 如何在cmake中链接共享对象?