Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@localhost tmp]# cat 52399819.sh
- getserver() {
- curl -X GET http://localhost:8000/json52399819.json
- }
- servers=$(getserver)
- echo $servers | jq .
- [root@localhost tmp]# curl -X GET http://localhost:8000/json52399819.json
- {
- "age":100,
- "name":"stackoverflow.com",
- "messages":["msg 1","msg 2","msg 3"]
- }
- [root@localhost tmp]#
- ===
- [root@localhost tmp]# bash -x 52399819.sh
- ++ getserver
- ++ curl -X GET http://localhost:8000/json52399819.json
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 100 86 100 86 0 0 12404 0 --:--:-- --:--:-- --:--:-- 14333
- + servers='{
- "age":100,
- "name":"stackoverflow.com",
- "messages":["msg 1","msg 2","msg 3"]
- }'
- + echo '{' '"age":100,' '"name":"stackoverflow.com",' '"messages":["msg' '1","msg' '2","msg' '3"]' '}'
- + jq .
- {
- "age": 100,
- "name": "stackoverflow.com",
- "messages": [
- "msg 1",
- "msg 2",
- "msg 3"
- ]
- }
Add Comment
Please, Sign In to add comment