Skip to content

hisatti77/shellmenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

shellmenu

Linux shell script to easily create Simple menu based scripts to help automate.

Methods

menuTitle <title> : Sets Heading of the menu addMenu

if string and action are not given then default is added. start : Starts the infinite loop: showMenu, promptInput, run actions

Sample shell script using this code

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]:

code

#! /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

About

Shell script to easily create Simple menu based scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages