Sponsored Content
Top Forums Shell Programming and Scripting How to include menu based options in Shell script? Post 302974255 by suresh3566 on Friday 27th of May 2016 02:29:20 AM
Old 05-27-2016
Debian How to include menu based options in Shell script?

Hi Friends,

I have a menu based tool which requires input/option to proceed further. How to make a shell script ?

eg: menu looks like

Get_data.sh
Code:
to continue (y/n) :


Here I need to key in "y" to proceed.

I want to prepare a script which should consider option y.

Last edited by RudiC; 05-27-2016 at 04:00 AM.. Reason: Added code tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help needed with menu options

I'm programming a menu for an intro to unix class and am hung up on 2 required options. One has to exit from unix. The other has to get a command prompt by using one of the menu choices, then return to the menu via CTRL-D. below is my code #!/bin/ksh #Jimmy's happy menu mesg y msg="ON"... (2 Replies)
Discussion started by: sanitywonko
2 Replies

2. Shell Programming and Scripting

menu.lst, boot options?

Hi all, I would like to have some details on menu.lst!! the reason is ,if i am trying to add my own boot option where do i need to add it? is it in menu.lst only or elsewere(am referring to unix os) because i tried adding a unique boot option and it was not reflected when the system booted?... (8 Replies)
Discussion started by: wrapster
8 Replies

3. UNIX for Dummies Questions & Answers

proceed through a menu-based program with a script?

I am trying to figure out a way to proceed through a menu-based program in UNIX with just one command to execute several steps. Is this possible? From the command prompt I would normally type the name of the program, 'disk_analysis' to start the program and bring up its menu. I would then... (4 Replies)
Discussion started by: nichola$
4 Replies

4. Homework & Coursework Questions

Menu Driven Shell Script which accepts1 to 5 options

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: 1) Write a Menu Driven Shell Script which accepts1 to 5 options and performs the following actions for... (1 Reply)
Discussion started by: vaghya
1 Replies

5. UNIX for Dummies Questions & Answers

[solved] Script creation (how to include options in the script)

Hi guys i have written a script which takes the options given to him and execute itself accordingly. for example if a script name is doctortux then executing doctortux without option should made doctortux to be executed in automatic mode i.e. doctortux -a or if a doctortux is needed to run in... (4 Replies)
Discussion started by: pinga123
4 Replies

6. Windows & DOS: Issues & Discussions

Windows Advanced Options Menu

I dual boot between Windows XP and Linux Mint. I am trying to get the Windows Advanced Options Menu to show up. Normally you would press f8 to make this happen when your computer is booting. With a dual boot it makes it way more complicated. If you press f8 when your computer first starts it does... (3 Replies)
Discussion started by: cokedude
3 Replies

7. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

8. Shell Programming and Scripting

Menu with sub-menu options

Hi! I have created on script which is working fine with menu options and with a sub-menu. I want to enhance it by using sub-options under menu options. Like. option 1) will give the list only. option 1.1) should give the option to user to choose one file, whose content user wanna see. ... (3 Replies)
Discussion started by: sukhdip
3 Replies

9. Shell Programming and Scripting

Automate the menu options using shell script

I have a menu option which will look as follows Select a menu option 1.change password 2.login as root user 3.show system version 4.quit Select> 1 please enter the new password: unix reenter the new password: unix press any key to enter (then displays again the menu options to enter the... (4 Replies)
Discussion started by: shivakumar6g
4 Replies

10. Shell Programming and Scripting

Creating bash script to process a data file based on the menu

Hey, im fairly new to unix and Im trying to make this unix project that would display a menu and do the following. MENU =========================== (p, P) Print users info (a, A) Add new user (s, S) Search user (d, D) Delete user (x,X) Exit Enter your choice: Trying to... (3 Replies)
Discussion started by: ultimaxtrd
3 Replies
menu_opts(3X)															     menu_opts(3X)

NAME
menu_opts - set and get menu options SYNOPSIS
#include <menu.h> int set_menu_opts(MENU *menu, OPTIONS opts); int menu_opts_on(MENU *menu, OPTIONS opts); int menu_opts_off(MENU *menu, OPTIONS opts); OPTIONS menu_opts(const MENU *menu); DESCRIPTION
The function set_menu_opts sets all the given menu's option bits (menu option bits may be logically-OR'ed together). The function menu_opts_on turns on the given option bits, and leaves others alone. The function menu_opts_off turns off the given option bits, and leaves others alone. The function menu_opts returns the menu's current option bits. The following options are defined (all are on by default): O_ONEVALUE Only one item can be selected for this menu. O_SHOWDESC Display the item descriptions when the menu is posted. O_ROWMAJOR Display the menu in row-major order. O_IGNORECASE Ignore the case when pattern-matching. O_SHOWMATCH Move the cursor to within the item name while pattern-matching. O_NONCYCLIC Don't wrap around next-item and previous-item, requests to the other end of the menu. RETURN VALUE
Except for menu_opts, each routine returns one of the following: E_OK The routine succeeded. E_SYSTEM_ERROR System error occurred (see errno). E_POSTED The menu is already posted. SEE ALSO
curses(3X), menu(3X). NOTES
The header file <menu.h> automatically includes the header file <curses.h>. PORTABILITY
These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions. AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. menu_opts(3X)
All times are GMT -4. The time now is 12:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy