From 7ca686634d69d983b9e3ba5ffe6463e16479aa8f Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Thu, 4 May 2017 09:35:38 +0100 Subject: [PATCH] jq: clarify descriptions (#1361) --- pages/common/jq.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/common/jq.md b/pages/common/jq.md index a7aa53b993..23891560a6 100644 --- a/pages/common/jq.md +++ b/pages/common/jq.md @@ -2,26 +2,26 @@ > A lightweight and flexible command-line JSON processor. -- Output JSON file: +- Output a JSON file, in pretty-print format: `cat {{file}} | jq` -- Output all elements from JSON array in file, or all key-value pairs from JSON objects in file: +- Output all elements from arrays (or all key-value pairs from objects) in a JSON file: `cat {{file}} | jq .[]` -- Read JSON objects from file, into array, and output (inverse of `jq .[]`): +- Read JSON objects from a file into an array, and output it (inverse of `jq .[]`): `cat {{file}} | jq --slurp` -- Output first element in JSON file: +- Output the first element in a JSON file: `cat {{file}} | jq .[0]` -- Output "key" of first element in JSON file: +- Output the value of a given key of the first element in a JSON file: -`cat {{file}} | jq .[0].{{key}}` +`cat {{file}} | jq .[0].{{key_name}}` -- Output "key" of each element in JSON file: +- Output the value of a given key of each element in a JSON file: -`cat {{file}} | jq 'map(.{{key}})'` +`cat {{file}} | jq 'map(.{{key_name}})'`