#!/bin/bash towns=("Sutton" "Oxford" "North Oxford" "Webster" "Grafton" "Dudley" "Charlton" "Cherry Valley" "Rochdale" "Paxton" "Spencer" "Worcester") base_url="http://localhost:9618/streets" state="MA" for town in "${towns[@]}"; do encoded_town="${town// /%20}" echo "Adding $town..." curl -s -X POST "$base_url/$encoded_town/$state" echo "" done