LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-27-2010, 04:37 PM   #16
dmafcoi
LQ Newbie
 
Registered: May 2010
Posts: 22

Original Poster
Rep: Reputation: 0

Quote:
Originally Posted by michaelk View Post
What was wrong with the code from post #12?
Typical response from a menu is when you press a wrong key an error message and the same menu items would be displayed again. You might want to use * case option if a b or c was not pressed.
ahh, OK, I see now. Nothing wrong with previous, it works fine, but that little bit of screen movement if i hit a key while reaching for my coffee or donut, then i have to scroll back, etc. so this is just cosmetic, i have an option to show the menu if i need it, I didn't want it popping up every time i pressed a key, so this works ok, no extra screen stuff going on.. never occurred to me I could just remove the mymenu :P oh well, I don't mind looking like an idiot as long as I'm learning something... thanks

Code:
#!/bin/bash

while [ 1 ]
do
	read -sn1 PRESSED
	case $PRESSED in
		a) echo "you typed a";;
		b) echo "you typed b";;
		c) echo "you typed c";;
		m) echo "i have a menu option";;
		*)
			beep
		;;
	esac
done
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
removing file with special characters rsashok Linux - General 4 02-09-2010 05:08 PM
Special characters in file names Jinouchi Linux - Newbie 7 07-25-2009 12:48 PM
How to remove file with name containing only special characters abhisheknayak Linux - Newbie 5 07-04-2008 11:53 AM
Use of special characters in .netrc file jlarsen Linux - General 3 08-01-2007 11:12 AM
File Copy Issue-Special Characters fortezza Linux - Software 1 11-14-2005 08:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration