【问题标题】:How to use # in linux terminal command如何在linux终端命令中使用#
【发布时间】:2020-11-11 20:26:19
【问题描述】:

我的密码中的一个字符包含 # 符号。因此,shell 在 # 符号之后省略了命令的其余部分。例如我在终端中执行了以下命令,

fabric-ca-client enroll -u "https://admin:#D******9@ca.m-zzz.n-zzzz.managedblockchain.us-east-1.amazonaws.com:30002" --tls.certfiles /home/ec2-user/managedblockchain-tls-chain.pem -M /home/ec2-user/admin-msp

由于密码中的#符号,我收到以下错误,

Error: Failed to create default configuration file: No username and password provided as part of the Fabric CA server URL

【问题讨论】:

  • 试试 '\' 因为这是字符串中的字符转义运算符
  • 已经试过了。但没有运气。
  • 尝试将字符串用 (') 代替双引号 (")。

标签: linux amazon-web-services shell terminal


【解决方案1】:

如果您需要在 CLI 中使用特殊字符,请尝试使用单引号 (') 而不是双引号 (")

fabric-ca-client enroll -u 'https://admin:#D******9@ca.m-zzz.n-zzzz.managedblockchain.us-east-1.amazonaws.com:30002' --tls.certfiles /home/ec2-user/managedblockchain-tls-chain.pem -M /home/ec2-user/admin-msp

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-23
    • 1970-01-01
    • 1970-01-01
    • 2017-11-23
    • 1970-01-01
    • 2021-06-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多