Shell menu script
Shell menu script
Today, I am going to share with you a simple Shell menu script, a silly man-machine interaction, and everyone can operate linux.
#! /Bin/sh # Shell menu demonstration function menu () {cat <EOF ------------------------------------ | **************************** | -------------------------------------- 'echo-e "\ 033 [35 m 1) electronic Device \ 033 [0 m "''echo-e" \ 033 [35 m 2) vehicle Information \ 033 [0 m "''echo-e" \ 033 [35 m 3) main Menu \ 033 [0 m "''echo-e" \ 033 [35 m 4) Exit \ 033 [0 m "'eofread-p" Enter the number of the corresponding product: "num1case $ num1 in 1) echo" Welcome to ELE homepage !! "Eleproduct_menu; 2) echo" Welcome to CAR homepage !! "Car_menu; 3) clear menu; 4) exit 0 esac} function eleproduct_menu () {cat <EOF ------------------------------------ | **************** | -------------------------------------- 'echo-e "\ 033 [35 m 1) apple \ 033 [0 m "''echo-e" \ 033 [35 m 2) meizu \ 033 [0 m "''echo-e" \ 033 [35 m 3) xiaomi \ 033 [0 m "''echo-e" \ 033 [35 m 4) return to the Main Menu \ 033 [0 m "'eofread-p" Enter the number of the corresponding product: "num2case $ num2 in 1) echo" the is iphone X $8888 !! "Eleproduct_menu; 2) echo" the is meizu pro6 ¥2600 !! "Eleproduct_menu; 3) echo" the is xiaomi MXA2 $4290 !! "Eleproduct_menu; 4) clear menu; *) echo" the is fail !! "Eleproduct_menuesac} function car_menu () {cat <EOF ------------------------------------ | ***************** CAR homepage **************** | -------------------------------------- 'echo-e "\ 033 [35 m 1) volkswagen \ 033 [0 m "''echo-e" \ 033 [35 m 2) BMW \ 033 [0 m "''echo-e" \ 033 [35 m 3) mercedes-Benz \ 033 [0 m "''echo-e" \ 033 [35 m 4) return to the Main Menu \ 033 [0 m "'eofread-p". Enter the number of the corresponding product: "num3case $ num3 in 1) echo" the is dazon ¥120000 !! "Car_menu; 2) echo" the is BMW $230000 !! "Car_menu; 3) echo" the is making $460000 !! "Car_menu; 4) clear menu; *) echo" the is fail !! "Car_menuesac} menu