parsing
This commit is contained in:
parent
8e0bb78527
commit
8924adedeb
2 changed files with 1 additions and 6 deletions
|
|
@ -101,7 +101,7 @@ mktemp_in() {
|
|||
json_value() {
|
||||
local key="$1"
|
||||
if [ "$OS" = "Mac" ]; then
|
||||
echo "$2" | awk -F"\"${key}\"[[:space:]]*:[[:space:]]*\"" '{print $2}' | awk -F'"' '{print $1}' | head -1
|
||||
echo "$2" | grep "\"${key}\"" | awk -F'"' '{print $4}' | head -1
|
||||
else
|
||||
echo "$2" | grep -oP "\"${key}\": \"\\K[^\"]+"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue