Sponsored Content
Top Forums Shell Programming and Scripting Menu and case statement scripting Post 302926914 by renegade11 on Friday 28th of November 2014 12:01:32 PM
Old 11-28-2014
Menu and case statement scripting

hi all
i am trying to get help with writing a script using case statement to display menu as
Code:
1) Authentication log 
2) System log 
3) Messages 
4) Dmesg 
5) Boot log 
Q) Exit

When selecting the menu by 1 or 2 or 3 o 4 or 5, it should display the last 10 lines of the log files,
if selected wrongly it should give an error and should not exit, rather the user should be able to
try again. Only entering Q it should exit.

Last edited by Don Cragun; 11-28-2014 at 05:41 PM.. Reason: Add CODE and ICODE tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

CASE statement

Hi, I am writing a bash shell script. My script has a few user defined parameters. When the script runs the first thing it does is make sure that these parameters are valid. One of the parameters is called YEAR. A valid input for YEAR can be 1997-2000. One way I have come up with to ensure... (3 Replies)
Discussion started by: msb65
3 Replies

2. UNIX for Dummies Questions & Answers

case statement in UNIX scripting (ksh)

Hi, I have a script like below : #!/bin/ksh echo "Do you want to export all docs ?" read alld echo "Do you want to export template or report only " read temr case && ] #arguments ;; case && ] #arguments ;; case && ] #arguments ;; (4 Replies)
Discussion started by: luna_soleil
4 Replies

3. Shell Programming and Scripting

case statement

Hi, I am writing case statement to execute some finction, my requirement is once one of the case statement is executed again it has to prompt for the option. for script in `echo "$Script_Selected"` do case $script in 1) getNoOFActUsers ;; 2) moveServerrOORotation ;; ... (2 Replies)
Discussion started by: Satyak
2 Replies

4. UNIX for Dummies Questions & Answers

menu + awk + while + case

the idea is to create script with menu and when option 1 or2 is pressed program should clear screan display info and get back to menu.... I managed some code but getting errors... #!/bin/bash choice1=ls -l|awk'{print $9 $1}' choice2= ls | wc -c choice3=exit while do clear echo "... (8 Replies)
Discussion started by: me.
8 Replies

5. Shell Programming and Scripting

Two columns output in simple case menu?

EDIT : System used : Any Linux distribution. Hello everyone, I m having quite a headache trying to figure out why I m having a 2 columns output in the following code : #!/bin/ksh menu_rotation() { #Variables CHOIX1="Rotation 1" CHOIX2="Rotation 2" CHOIX3="Rotation 3" ... (11 Replies)
Discussion started by: Sekullos
11 Replies

6. Homework & Coursework Questions

Case Statement

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: Hey, guys I really need some help with a project. "Write a shell program that examines the command line... (8 Replies)
Discussion started by: sk192010`
8 Replies

7. Shell Programming and Scripting

Need help in create menu with 3 sub menu using the case command

hi all i am a newbie to this is there any examples on creating a main menu with 3 sub menu main menu -> option a , b and c a menu -> option 1 ,2 and 3 b menu -> option 1 ,2 c menu -> option 1 ,2 i am getting headache as my code kept getting unexpected EOF ---------- Post... (0 Replies)
Discussion started by: chercm
0 Replies

8. Shell Programming and Scripting

Special case to skip function in bash menu

In the bash menu below if the variant that is inputted is in the format NM_004004.3:c.274G>T the below works perfectly. My question is if the variant inputted isNM_004004.3:-c.274G>T or NM_004004.3:+c.274G>T then the code as is will throw an error due to a biological issue. Is it possible to to... (1 Reply)
Discussion started by: cmccabe
1 Replies

9. Shell Programming and Scripting

Update Statement User menu input screen

Hi Guys, Any good reference for me to perform user database update statement on table which has quite number of fields could be updated depend on user specified column name and the value to assign. All the approaches are welcome and appreciated. Thanks. (1 Reply)
Discussion started by: ckwan123
1 Replies

10. Shell Programming and Scripting

Shell scripting with case statement

Foe example we have three environments int,qa and prod.Each environment has some number of servers. int=Server1,Server2,Server3 qa=Server4,Server5,Server6 prod=Server7,Server8,Server9 echo "Enter the Environment i.e int,qa,prod" read env case $env in int) ## Need command where all the... (9 Replies)
Discussion started by: nareshreddy443
9 Replies
VTTEST(1)						      General Commands Manual							 VTTEST(1)

NAME
vttest - test VT100-type terminal SYNOPSIS
vttest [options] [24x80.132] DESCRIPTION
Vttest is a program designed to test the functionality of a VT100 terminal (or emulator thereof). It tests both display (escape sequence handling) and keyboard. The program is menu-driven and contains full on-line operating instructions. - To run a given menu-item, you must enter its number. - Menu items start at zero; this is the "Exit" item in almost all cases. - You can run all menu-items (for a given level) by entering an asterisk, i.e, `*'. - You can force a repaint of the menu items by entering "?". - A few menus can be more than one page. Use "n" and "p" to switch to the next or previous page. OPTIONS
You can specify the screen geometry in the form [24x80.132], i.e., 24 lines, 80 minimum columns, 132 maximum columns. If your terminal does not switch between 80 and 132 columns you may specify 24x80.80, for example, to avoid a misleading display. Other options are: -f file specify a file containing a DRCS (soft character definition) string. -l log test results to vttest.log. -p use padding, e.g., for a VT100 connected to a high-speed line. -s add time-delay in selected panning/scrolling options to show details. -8 use 8-bit controls (this can be changed with a menu option). AUTHOR
Per Lindberg (mcvax,seismo)!enea!suadb!lindberg sometime 1985. Modified by Thomas Dickey from June 1996, to support nonstandard screen geometry, VT220-VT520, ISO color and xterm-specific tests. LOCAL VTTEST(1)
All times are GMT -4. The time now is 02:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy