As I am more of a web guy, i need a little help with this one, so I will explain what I am trying to do before I ask.
I am creating batch script that will:
- GET request from an external server (json file), receive data, save locally as .json
- Use JQ to navigate the json for result[0].title
- Use the 'title' as a parameter for a curl request
Once I have the file locally. I would use JQ to find the data in the object
cat file.json | jq '.results[0].title' > $1 &&
curl -i -H "Accept: application/html" -H "Content-Type: application/html" -X GET http://example.com/test/$1 > test.txt
Is is possible to set local variables in command line '$1' for temporary use in a piped command?
Am I waaay off here?