I want to invoke curl (which invokes a REST service) for every matching row processed via awk.
Input file (delimited by colon). e.g.
$ cat /tmp/input
tiger:EN
haiti:FR
federer:CH
I got as far as this:
awk -F':' '{print $1 "=" $2}' /tmp/input
This just confirms that I can extract the columns out correctly.
Now I need to invoke the REST service like this:
curl -XPOST -H "Content-Type: application/json"
-d "{ lang: EN, name: tiger }" http://server/rs/user
Is it possible to write a one-liner in awk to do this, or should I write a bash script? Thanks