Bash script combine echo say and read Using a bash script on Mac OS X, how do I combine echo, say and read to make it cleaner and less line of code?  The below script works but to me there are too many lines.  Thanks a lot for your help.

#!/usr/bin/env bash

clear

echo -n "Enter your first name: "
say "Enter your first name"
read -r name
echo -n "Enter your last name: "
say "Enter your last name"
read -r lastname
say "Good morning ${name}${lastname}"
You can define functions in bash:

echoAndSay() {
    say $*
    printf "%s: " "$*"
}

echoAndSay "Enter your first name"
read -r name
echoAndSay "Enter your last name"
read -r lastname
say "Good morning ${name} ${lastname}"