Commit 8d6e0585 authored by omwansafelix's avatar omwansafelix

update: directly pipe required url data to urlData.txt instead of creating json file.

parent dddb1843
#Author: Felix Omwansa #Authors: Allan Juma and Felix Omwansa
##buildESP32_update: get data for broadcast_url from Bitsoko server ##buildESP32_update: get data for broadcast_url from Bitsoko server
##Parsing a json response of a url to a file ##Parsing a json response of a url to a file
...@@ -34,18 +34,19 @@ ...@@ -34,18 +34,19 @@
echo "" echo ""
echo "[$0]: creating json file to store response..." echo "[$0]: creating data file to store response..."
sleep 3 sleep 3
if [ -f test.json ] if [ -f urlData.txt ]
then then
rm test.json rm urlData.txt
fi fi
#create json file to store response
echo "${RESP}" | jq . >> test.json
echo "[$0]: url data : " #directly pipe required url data to urlData.txt
jq -r '.[].name' test.json echo "${RESP}" | jq -r '.[].name' >> urlData.txt
#prints value of 'name'
echo ""
echo "[$0]: finished"
sleep 3 sleep 3
####
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment