如何在终端中传递带引号和单引号的密码? [英] How to pass a password with quotes and single quotes in terminal?

查看:24
本文介绍了如何在终端中传递带引号和单引号的密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的 Android 应用程序创建了一个 .keystore,生成了一个随机密码.它在同一个密码中包含引号 (") 和单引号 ('),例如:xxxxxx"xxx!\x='x

我正在尝试使用 keytool 传递密码.如何传递密码?

keytool -list -storepass ""-keystore my.keystore

并显示:

<块引用>

-bash: !\xx'x": 事件未找到

谢谢!

编辑我尝试使用:

keytool -list -storepass xxxxxx\"xxx\!x=\'x -keystore my.keystore

<块引用>

keytool 错误:java.io.IOException:Keystore 被篡改,或密码不正确

解决方案

不幸的是,我猜您必须对特殊字符进行转义,如下所示:

xxxxxx\"xxx\\!xx\'x

I created a .keystore for my Android application, generating a random password. It contains quotes (") and singles quotes (') in the same password, like this one: xxxxxx"xxx!\x='x

I am trying to pass the password using keytool. How can I pass the password?

keytool -list -storepass "<my_password>" -keystore my.keystore

And shows:

-bash: !\xx'x": event not found

Thanks!

EDIT I tried using:

keytool -list -storepass xxxxxx\"xxx\!x=\'x -keystore my.keystore

keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect

解决方案

Unfortunately I guess you have to escape the special characters, like this:

xxxxxx\"xxx\\!xx\'x

这篇关于如何在终端中传递带引号和单引号的密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆