diff --git a/docs/jq.md b/docs/jq.md index b3ee7be..53404b7 100644 --- a/docs/jq.md +++ b/docs/jq.md @@ -229,6 +229,25 @@ $ echo '42' | jq '"The input was \(.), which is one less than \(.+1)"' ``` +### 字符串转 JSON 数组 + +```bash +$ echo 'a b c d' | jq -R 'split(" ")' +``` + + +输出结果 + +```json +[ + "a", + "b", + "c", + "d" +] +``` + + 另见 ----