Categories
Linux Mastering Development

how to use seq with xargs to curl request

I’m working on curl commmand
that performs an action based upon parms value

curl 'http://www.example.com/actionid?id=123'

id value i want to pump dynamically so

seq 1 10 | xargs -I + curl 'http://example.com/actionid?id=123'

In output I’m getting

curl 'http://example.com/actionid?id=+'

curl 'http://example.com/actionid?id=+'

curl 'http://example.com/actionid?id=+'
....

how can I pass it as value I also tried

seq 1 10 | xargs -I + curl 'http://example.com/actionid?id=123'`< <(printf '+\n' $(seq 1 10)

I’m getting the same results.

solution

placed ' around -I '~' and its working now.

Leave a Reply

Your email address will not be published. Required fields are marked *