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
XHPGetServerMode(3X)													      XHPGetServerMode(3X)

NAME
XHPGetServerMode - Get the mode of the specified screen. SYNOPSIS
int XHPGetServerMode (display, screen) Display *display; int screen; ARGUMENTS
display Specifies the connection to the X server. screen Specifies the number of the screen whose mode is requested. DESCRIPTION
This request enables a client program to determine the mode of a screen. The mode returned is an integer that can be compared against one of the predefined modes. The following modes are defined: XHPOVERLAY_MODE The X server is running in the overlay planes. XHPIMAGE_MODE The X server is running in the image planes. XHPSTACKED_SCREENS_MODE The X server is running with the overlay and image planes on different screens. XHPCOMBINED_MODE The X server is running in both the overlay and image planes. These constants can be obtained by including the file /usr/include/X11/XHPproto.h. If an invalid screen number is used, a -1 will be returned by this request. DIAGNOSTICS
The return value indicates success or failure. RETURN VALUE
This request returns the display mode if the request is successful, and a -1 if an invalid screen id is used. FILES
/usr/include/X11/XHPproto.h ORIGIN
Hewlett-Packard Company X Version 11 Release 5 XHPGetServerMode(3X)
All times are GMT -4. The time now is 06:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy