Bash script combine echo say and read

Solution 1:

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}"