Sponsored Content
Top Forums Shell Programming and Scripting Display a menu on bottom right of screen Post 302434127 by pseudocoder on Thursday 1st of July 2010 11:53:19 AM
Old 07-01-2010
Code:
#!/usr/local/bin/ksh93

# option 1: ls
# option 2: ls -l
# option 10: exit
# options 3-10: undefined

function menu {

  for ((i=1;i<=10;i++)); do printf "%80s\n" "$i. option $i "; done

  printf "%77s" " ->  "

  read opt

   case $opt in
	"1") ls; menu;;
	"2") ls -l; menu;;
	"10") exit;;
	*) echo "Invalid or undefined option!"; menu;;
   esac

}


#printf "\n\n\n\n\n\n\n\n\n\n\n\n\n"
menu

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

controlling screen display

How can I control the screen output when trying to read a large file onto the screen x number of lines at a time. I'm trying to use this is a bourne shell script. I want to display 10 lines of a file, pause the screen so that a user can read the file, and then display the next 10 lines of the file,... (6 Replies)
Discussion started by: jrdnoland1
6 Replies

2. Shell Programming and Scripting

screen display help

Hello All, I have a file that is formatted like this 1234556 1234567 1234588 1123888 1999999 1010101 1919191 1919191.... for a total of 26000 + lines how do I get a script to read lets say 50 lines at a time and display the output to the screen in column format around 5 or 6... (2 Replies)
Discussion started by: zilla30066
2 Replies

3. Shell Programming and Scripting

Menu at the bottom

Hi everyone, I'm new to Linux and bash scripting. Question? How can I display a menu at the bottom of the screen when displaying a content of a file with the less command? Like in gvim with bash support, when debugging or testing your script this text "Press enter or type command to... (0 Replies)
Discussion started by: Qwond
0 Replies

4. AIX

Increasing screen display size

Hi, How can i increase the size of my display on AIX 5.3.What i mean is e.g if i do and ps -ef i would get some like: /data/app/oracle/product/10.2 /usr/bin/ksh /usr/local/bin/s i want it to show the whole thing on the screen without cutting it,because there is still space on the screen... (0 Replies)
Discussion started by: sellafrica1
0 Replies

5. Shell Programming and Scripting

Menu / Log files - reading / display

So I'm pretty green still at this, and right now I don't even have the IF statements in just trying to get this part to work. I want to basically click optino 1,2,3,4 for which logs I want to search, and then be able to put in the variable I want to grep out? Sounds easy just not clear in my mind... (4 Replies)
Discussion started by: xgringo
4 Replies

6. UNIX for Advanced & Expert Users

How to display the files on screen

I connect via vnc to a linux computer. after a logout, I cannot see the files on the screen (although i can see the screensaver). I can open a terminal and see the files etc. How can i see the files on the screen again? (5 Replies)
Discussion started by: FelipeAd
5 Replies

7. 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

8. Shell Programming and Scripting

Display user selction from bash menu

I am trying to display the text the user selects from a bash menu. The below will display the menu and allow the user to enter a number, but will not display the choice selected. bash while true do printf "\n please make a selection from the MENU \n ... (4 Replies)
Discussion started by: cmccabe
4 Replies

9. Post Here to Contact Site Administrators and Moderators

Newbie reports: some posts show only the title and bottom-of-page menu. No text in the middle!

When I try to look at some of the posts (like "Rookie Grandmother"), I see the thread title and the menu at the bottom, but not the text of the post in the middle. I can see ALL of the posts in the Recent menu, but NONE of the others. The screenshot I attached shows the situation. I just... (2 Replies)
Discussion started by: JRWoodward
2 Replies

10. Shell Programming and Scripting

How do we display specific row of an output from bottom given line number?

I pass a number to my script. Passing "1" below. ./getfile.sh 1 echo "User entered: $1" ls -ltr *.conf | sed -n '$p' I wish to use ls -ltr i.e list files in ascending order of time the latest showing at the bottom of the output. Number 1 should get me the last row of ls -ltr output i.e... (9 Replies)
Discussion started by: mohtashims
9 Replies
PDMENU(1)							     Commands								 PDMENU(1)

NAME
pdmenu - simple full screen menu program SYNOPSIS
pdmenu [options] [menufile ...] DESCRIPTION
pdmenu is a simple menu program that displays a menu from which the user can pick programs to run. Submenus are supported. When you run pdmenu , you will be presented with a menu. Simply use the arrow keys to move to the program you want to run, and press Enter to run the program. When the program ends, you will be returned to the menu. If you are running pdmenu at the linux console, and gpm is running, you can move the mouse and click to navigate through the menus. Some menu items are actually submenus, and will take you to another menu. Others may cause a text edit window to be displayed, where you can enter parameters for a command before running it. Still others may run a command, and display the output in a window. KEYS
Here are all keys you need to get around in pdmenu: [up arrow], 8, - Move up one line in the menu. [down arrow], 2, + Move down one line. [page up], [ctrl-u] Move up an entire screen. [page down], [space], [ctrl-v] Move down an entire screen. [home] Move to the first entry of the menu. [end] Move to the last entry of the menu. q Exit the current menu, or exit pdmenu if used on the first menu. Does not work in the text edit windows. (This will not work if there is also a hotkey set up for 'q', the hotkey takes precedence.) ESC Close the currently active window, and return to the previous window, or exit pdmenu if used on the first menu. [ctrl-c] Exit pdmenu immediately. [ctrl-r] Force a redraw of the screen. [enter] Launch the selected menu item. In a text edit window, closes the window. [backspace] Performs a destructive backspace in a text edit window. hotkeys Some letters of a menu item may be highlighted. These are hotkeys; simply press the highlighted letter to select the next menu item with that hotkey. OPTIONS
-h, --help Display usage summary and exit. -c, --color Use color. By default, pdmenu will display in black and white mode. If your terminal supports color, use this switch. -u, --unpark "Unparks" the cursor from the bottom of the screen. When this option is selected, the cursor moves to be on the line of the menu that is currently selected. This makes pdmenu more useable with speech synthesis systems that need to know what line is the current line on the screen. -mmenuid, --menu=menuid Instead of displaying the first menu from the menufile, select the menu with the id "menuid" and display it. -q, --quit By default, at the opening menu, 'q' will exit pdmenu. If the -q switch is specified, this will not be the case. This is useful if you want to prevent the user from ever exiting pdmenu. (This also disables control-c and the right mouse button from exiting pdmenu.) -r, --retro This makes pdmenu use an old style for displaying menus. Menus in the background don't change color, or lose their hotkeys. Note that this will also be a little bit faster than the default on slow terminals and the like. -l, --lowbit By default, pdmenu will use nice high bit line drawing characters if it thinks your terminal is capable. Sometimes it gets this wrong and you get borders that look all messed up. Then you should use this --lowbit switch to force it to use low bit line drawing characters. -n, --numeric Disables the use of the keys 2 and 8 for moving up and down. This is useful if you want to use numbered hotkeys. menufile ... Specify a menu definition file or files to use. If you specify multiple files, they will all be loaded in together. By default, the first menu in the first menufile will be displayed when pdmenu starts, but this can be overridden by the --menu= option. If menu- file is "-", pdmenu will read standard input as a menu file. NOTES
To use the mouse to cut and paste as usual, hold down on the shift key when you use the mouse. FILES
/etc/pdmenurc Default config file. See pdmenurc(5) for details. ~/.pdmenurc If this exists, it overrides /etc/pdmenurc. See pdmenurc(5) for details. ENVIRONMENT
COLORTERM Set this variable to make pdmenu to use color by default. DISTRIBUTION
Redistribution is subject to the GNU public license. BUGS
See the file BUGS that came with pdmenu for the current buglist. AUTHOR
Joey Hess, <joey@kitenet.net>. SEE ALSO
pdmenurc(5) 1.3.2 August 23 2011 PDMENU(1)
All times are GMT -4. The time now is 10:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy