Advertisement
Guest User

Untitled

a guest
Mar 13th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. function jsonval {
  4. temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
  5. echo ${temp##*|}
  6. }
  7.  
  8. #posle GET zamenuvas so tvojot link
  9. json=`curl -s -X GET http://194.33.12.24/timetables/liveBusArrival?station_int_id=1934`
  10. #koj parametar go baras go stavas tuka, primer ovde go baram "route_name"
  11. prop='route_name'
  12. #tuka dobivas vrednosta na parametarot
  13. res_value=`jsonval`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement