#!/bin/bash # # selectstatment - demonstrates use of select statement # if [ -z $1 ]; then echo -e " Usage: please supply multiple arguments \n " fi #PS3 is where select gets its prompt from PS3="Select one of the arguments you entered: " select selection in "$@"; do if [ $selection ]; then echo "Your selection was: $selection" # REPLY is a built-in shell variable echo "The number you typed was: $REPLY" break # without a break you would loop forever else echo "Invalid selection." fi done