-
Notifications
You must be signed in to change notification settings - Fork 0
ShellMenu Linux script to automate creating menu based shell scripts
Satinder Singh edited this page Jun 15, 2023
·
1 revision
Linux shell script to easily create Simple menu based scripts to help automate.
menuTitle <title> : Sets Heading of the menu
addMenu <menu string> <menu action function name>
if string and action are not given then default is added.
start : Starts the infinite loop: showMenu, promptInput, run actions
Sample script below creates this menu and related handlers:
============================
News Manager
============================
2. Delete Group from db
1. Add Group to db
0. Exit
Please Select Menu [0 - 2]:
#! /bin/bash
#source this file
. ./menu.sh
#menu action function
function addGrpDb
{
echo "Code menu handler here"
}
#set menu heading
menuTitle "News Manager"
#add menus
addMenu "Add Group to db" addGrpDb
addMenu "Delete Group from db" delGrpDb
#Start the main loop
start