Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 728 Bytes

File metadata and controls

21 lines (13 loc) · 728 Bytes

This repository is intended for shell script examples

Content


Execute command passing parameter resulting from another command

This example will download the jpeg file getting the address of image from json response on the first command

To perform this is necessary use the jq and xargs commands

The jq helps to get the address of image on thumbnail attribute from json response of the first curl

The xargs put the output from jq on second curl command

curl -s -X GET https://dummyjson.com/products/1 | jq '.thumbnail' | xargs curl  -O