Skip to content

Commit ee1f45c

Browse files
author
Juliano Santos
committed
Atualização da função "GetAllKeys" para extração de objetos json.
1 parent b6be3d4 commit ee1f45c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

ShellBot.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ GetAllValues(){
133133
}
134134

135135
GetAllKeys(){
136-
local key; jq -r 'path(..|select(type == "string" or type == "number" or type == "boolean"))|map(if type == "number" then .|tostring|"["+.+"]" else . end)|join(".")' <<< $* | \
137-
while read key; do echo "${key//.\[/\[}"; done
136+
jq -r 'path(..|select(type == "string" or type == "number" or type == "boolean"))|map(if type == "number" then .|tostring|"["+.+"]" else . end)|join(".")|gsub("\\.\\[";"[")' <<< $*
138137
}
139138

140139
FlagConv()

0 commit comments

Comments
 (0)