当我在多行上拆分文本行并使用命令"jq . words.json“在屏幕上显示JSON文件时,我得到了一个JSON。
在单行上带有文本值的JSON文件如下所示
{
"words" : "one two three four five"
}
命令“jq.words.json”运行良好,并在屏幕上显示JSON文件。
但是,当我将值“一二三四五”除以两行并运行相同的命令时,就会得到一个解析错误。
{
"words" : "one two
three four five"
如何使用grep
字符串"TEST-4902:这是一个长占位符字符串“。
命令
gh pr view 1 --repo joe/test-gh-cli --json body --jq .body | grep -v "TEST-[0-9]{3,4}"
结果
[TEST-4902]: This is a long placeholder string
如何只返回“这是一个长占位符字符串”
预期产出
This is a long placeholder string
我有一个只有一个对象的json文件,如下所示。我叫它Auth.json
{
"name": "Authorization",
"description": "This parameter represents the Authorization token obtained from the OKTA Authorization server. It is the Bearer token provided to authorize the consumer. Usage Authorization : Bearer t