我有一json
本字典
$ cat foo.json
{
"black": "#073642",
"red": "#DC322F",
"green": "#859900",
"yellow": "#CF9A6B",
"blue": "#268BD2",
"purple": "#D33682",
"cyan": "#2AA198",
"white": "#EEE8D5",
"brightBlack": "#657B83",
"brightRed": "#D87979",
"brightGreen": "#88CF76",
"brightYellow": "#657B83",
"brightBlue": "#2699FF",
"brightPurple": "#D33682",
"brightCyan": "#43B8C3",
"brightWhite": "#FDF6E3",
"foreground": "#839496",
"background": "#002B36",
"cursorColor": "#839496"
}
我想用它jq
来打印出这本字典中的所有值。所以,输出应该是:
$ jq 'magic' foo.json
#073642
#DC322F
#859900
#CF9A6B
#268BD2
#D33682
#2AA198
#EEE8D5
#657B83
#D87979
#88CF76
#657B83
#2699FF
#D33682
#43B8C3
#FDF6E3
#839496
#002B36
#839496
'magic'
我在找什么?
这是
.[]
对对象的作用:要获得准确的结果,您还需要
jq -r
/--raw-output
省略 JSON 字符串引号: