Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 527

Storing output of a curl jq to environment variable in windows cmd

$
0
0

I want to save the output of curl -X GET "http://localhost:8080/test" ^| jq -r ".integrations.[0].id" to an environment variable within a jenkins batch command in Windows8 so that I can use it in subsequent commands.

How to do that?

I tried this but did not work.

@echo off ^for /F "delims=" %%i in ("curl -X GET "http://localhost:8080/test" ^| jq -r ".integrations.[0].id"") do (set "response=%%i") ^echo ID = %response% ^endlocal

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>