function box_out() { local s=("$@") b w for l in "${s[@]}"; do ((w<${#l})) && { b="$l"; w="${#l}"; } done tput setaf 3 echo " -${b//?/-}- | ${b//?/ } |" for l in "${s[@]}"; do printf '| %s%*s%s |\n' "$(tput setaf 4)" "-$w" "$l" "$(tput setaf 3)" done echo "| ${b//?/ } | -${b//?/-}-" tput sgr 0 } box_out "Welcome!" "This utility tool will help you create the required resources for $(whoami)" "Please review the pre-requisites at the following link before proceeding: " "" "https://github.com/aws-samples/amazon-redshift-infrastructure-automation#prerequisites" echo