#!/bin/bash foo1() { echo 'hello from foo1!'; } foo2() { ls -l; } foo3() { echo 'hello from foo3!'; } # read -p "Enter a Number (1,2, or 3): " num if [[ $1 = [123] ]]; then # validate input foo"$1" fi