From 14cefcc7f96a997fc5f43f6c2abd51e457574f0b Mon Sep 17 00:00:00 2001 From: chuanjin Date: Thu, 27 Jun 2019 11:08:39 +0200 Subject: [PATCH] Update jq page with correct command format --- pages/common/jq.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/common/jq.md b/pages/common/jq.md index 36a84feedd..14cc235263 100644 --- a/pages/common/jq.md +++ b/pages/common/jq.md @@ -9,7 +9,7 @@ - Output all elements from arrays (or all key-value pairs from objects) in a JSON file: -`jq .[] {{file.json}}` +`jq '.[]' {{file.json}}` - Read JSON objects from a file into an array, and output it (inverse of `jq .[]`): @@ -17,11 +17,11 @@ - Output the first element in a JSON file: -`jq .[0] {{file.json}}` +`jq '.[0]' {{file.json}}` - Output the value of a given key of the first element in a JSON text from `stdin`: -`cat {{file.json}} | jq .[0].{{key_name}}` +`cat {{file.json}} | jq '.[0].{{key_name}}'` - Output the value of a given key of each element in a JSON text from `stdin`: