#!/bin/bash RED_COLOR='\E[1;31m' GREEN_COLOR='\E[1;32m' YELLOW_COLOR='\E[1;33m' BLUE_COLOR='\E[1;34m' PLNK='\E[1;35m' RES='\E[0m' menu(){ cat << EOF 1:apple 2:pear 3:bannana 4:cherry EOF read -p "inpit number [1|2|3|4] :" furl1 } usage(){ echo -e "${GREEN_COLOR} inpit number [1|2|3|4] : $RES" echo =========================================== } color(){ case $furl1 in 1) echo -e "${RED_COLOR} apple $RES " ;; 2) echo -e "${GREEN_COLOR} pear $RES" ;; 3) echo -e "${YELLOW_COLOR} bannana $RES" ;; 4) echo -e "${BLUE_COLOR} cherry $RES" ;; *) usage esac } main(){ while true do menu color done } main
Last modification:July 22, 2019
© Allow specification reprint