【问题标题】:Running awk inside of tox在 tox 中运行 awk
【发布时间】:2020-11-22 22:49:41
【问题描述】:

我已将以下命令配置为 tox 中的命令。

bash -c "ps | awk '{print $1}'"

因为使用 {} 进行替换,我收到一个 tox 配置错误,提示 print $1 不存在。有没有好的解决方法?

【问题讨论】:

    标签: python tox


    【解决方案1】:

    来自the documentation on substitutions

    如果需要,可以使用 \ 字符对花括号进行转义,例如:

    commands = echo "\{posargs\}" = {posargs}
    

    免责声明:我是 tox 维护者之一

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-28
      相关资源
      最近更新 更多