I want to extract url from the following:
{"code": 0, "data": {"cdnFileUrl": "http://download.example.com.cn/download/product/mi/rules/example_url_201902123.pkg", "code": 0, "message": "success", "packageVersion": "20190219141705"}, "message": "success"}
you can get the correct result by using the following command:
cat info1.txt | grep-Po""cdnFileUrl": "[0-9aLZAMALIZUMAURAVO.] +""| awk-F"""{print $(NF-1)}"
http://download.example.com.cn/download/product/mi/rules/example_url_201902123.pkg
but now the docking department has changed the connection form and added a question mark to the link. I searched the question mark for special treatment, but I don"t know how to do it. The changed information is as follows:
{"code": 0, "data": {"cdnFileUrl": "http://download.example.com.cn/download/product/mi/rules/example_url_201902123.pkg?secret3u4o3dbhj", "code": 0, "message": "success", "packageVersion": "20190219141705"}, "message": "success"}
so how to extract it
http://download.example.com.cn/download/product/mi/rules/example_url_201902123.pkg?secret3u4o3dbhj