#!/bin/bash f() { for i in {1..5}; do curl -X 'POST' \ "http://$1:9999/api/" \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "type": "Item", "quantity": 1, "address": "Example Address '"$i"'" }' done } f $1