jq:如何在Windows的原始输出上输出报价 [英] jq: How to output quotes on raw output on windows

查看:52
本文介绍了jq:如何在Windows的原始输出上输出报价的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用原始输出,我必须引用输出的一些值.

Using raw output I have to quote some values of the output.

echo [{"a" : "b"}] | jq-win64.exe --raw-output ".[] | \"Result is: \" + .a + \".\""

产生

Result is: b.

但是我怎么产生

Result is: "b".

不幸的是,它必须在CMD文件内部调用的Windows上运行.

Unfortunately it has to run on Windows called from inside a CMD file.

推荐答案

您需要转义斜线以转义"

You need to escape the slashes to escape a "

$ echo [{"a" : "b"}] | jq-win64.exe --raw-output ".[] | \"Result is: \\\"\" + .a + \"\\\".\""
Result is: "b".

这篇关于jq:如何在Windows的原始输出上输出报价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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