From e7a6036b0da18fea768b9123c496335fbbd87770 Mon Sep 17 00:00:00 2001 From: TCL <1620508360@qq.com> Date: Thu, 27 Apr 2023 03:42:40 +0800 Subject: [PATCH] fix: grap json --- dependency/shell/run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependency/shell/run.sh b/dependency/shell/run.sh index 104220f..c452721 100644 --- a/dependency/shell/run.sh +++ b/dependency/shell/run.sh @@ -63,6 +63,6 @@ else fi result=$(cat /usr/local/playback/result.json) -score0=$(parse_json $result "Student") -score1=$(parse_json $result "Tricker") +score_0=$(echo "$result" | grep -oP '(?<="Student":)\d+') +score_1=$(echo "$result" | grep -oP '(?<="Tricker":)\d+') curl $URL -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"result":[{"team_id":0, "score":'${score0}'}, {"team_id":1, "score":'${score1}'}], "mode":'${MODE}'}'