I have a text file containing variables of fqdn and hostname. File looks like this
first_fqnd first_hostname
second_fqdn second_hostname
..... .....
I have to update some data using curl in a bash script, but I have to take fqdn and hostname from this text file and make a curl for every pair fqdn and hostname.
My curl should be like this:
curl -H "Content-Type:application/json" -XPUT "https://pup.pnet.pl/api/hosts/**fqdn from file**" -d '{"host":{"name": "**hostname from file**"}}' --cacert bundle.pem --cert xxx-pem.cer --key xxx-privkey.pem
How can I pass these variables from file to curl? I've thought about using awk, but I don't know how to use it in curl command