#!/bin/bash
url='example.com:7000'

IFS=: read host port _ <<< "$url:8080"

# check host and port values
declare -p host port
echo '------'

url='example.com'

IFS=: read host port _ <<< "$url:8080"

# check host and port values
declare -p host port
