Scripting menu problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Scripting menu problem
# 1  
Old 05-11-2010
Scripting menu problem

Hi there, I am new to Unix and at the moment
I am trying to solve my assignment that is to create a script for the program
to prompt user to type three codes,
from user point of view it should be done by
typing codes separating them by spaces.
Then program displays a menu with these three
codes and asks to choose one, the user
should type the number of the chosen code
in the list and the user should be able to type numbers
until it is one of three numbers in list.
I have managed a piece but I feel it doesnt reflect what is asked, could anybody please help me to get on right direction or give me some tips.
Code:
echo "Could you please input three codes
        for me:  $code1 $code2 $code3"

echo ******* Select from menu *******
case $Keypress in
"1")$1
"2")$2
"3")$3
echo
until[ $# < 4 ]
do
  echo "You choose: \c"
  read Keypress
done

# 2  
Old 05-11-2010
Cross-posting is not allowed!
# 3  
Old 05-11-2010
Well I was kicked from the other forum because my question was not relevant to that forum, what can i do?
# 4  
Old 05-11-2010
Please Proceed with your QUESTION in this Forum only...
And read the rules before posting...SmilieSmilie

Thanks.
# 5  
Old 05-11-2010
I still hope someone can help me with my thread Smilie
# 6  
Old 05-11-2010
Hate to burst your bubble once more, but...
I'm going to close this thread with no infraction.

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Problem with menu

Everything in the following script works fine, except the jobs command. It works when the script is not running, but does not work in the script itself and I cannot figure out why. Any help would be greatly appreciated. using bash shell clear while echo " A: Jobs" echo " B: PS" echo " C:... (2 Replies)
Discussion started by: silencep77
2 Replies

2. Shell Programming and Scripting

Menu and case statement scripting

hi all i am trying to get help with writing a script using case statement to display menu as 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... (3 Replies)
Discussion started by: renegade11
3 Replies

3. Homework & Coursework Questions

Shell scripting/menu

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: Write a shell menu program that will: a. copy a file to a designated directory b. tell you if a specified user... (13 Replies)
Discussion started by: Jagst3r21
13 Replies

4. UNIX for Dummies Questions & Answers

Menu Script problem

Im new to unix/linux and am having trouble with this one. My problem is when i enter 9 to exit it doesnt do so. also option 6 doesent display the time. Its getting to be frustrating. I know there are probably alot of bug in this bu these basic ones are really odd. #!bin/bash # until ... (3 Replies)
Discussion started by: christ.666
3 Replies

5. Shell Programming and Scripting

Script menu problem

Hi there, I am new to Unix and at the moment I am trying to solve my assignment that is to create a script for the program to prompt user to type three codes, from user point of view it should be done by typing codes separating them by spaces. Then program displays a menu with these three... (2 Replies)
Discussion started by: Dannel
2 Replies

6. Shell Programming and Scripting

Ive got a problem with menu sub commands

Ive got a problem fron a menu script where: If i choose option 1 it will run a command for instance option 1 will run another script that will grep for a certain process name also using the If command. IE if chicken process is present echo cluck cluck, but if no chicken then echo no eggs... (4 Replies)
Discussion started by: wmccull
4 Replies

7. Shell Programming and Scripting

help with scripting a simple menu

Hi there. I'm trying to teach myself UNIX but the book I bought is a bit confusing. I'm trying out this exercise and I think I'm on the right track, but I'd appreciate any suggestions on how to improve what I have so far. Also, I'm not clear on how to use the read command to utilize the user's... (3 Replies)
Discussion started by: Jsmith
3 Replies

8. Ubuntu

Start Menu Problem

I posted this at another forum 25 minutes ago and it has only been looked at once. I have much more faith in this forum, as I've had some good help in the shell scripting forum. So I'll just repost this here. I don't know if this is an (K)Ubuntu specific problem, but that is what I use. Problem... (0 Replies)
Discussion started by: notsomeone
0 Replies

9. Shell Programming and Scripting

Scripting problem - when the file is not found i want it to return to the menu

when the file is not found i want it to return to the menu, however it carries out the next line when i hit a key I know its probably something simple can anyone help? here is my pause function: function pause(){ read -s -n 1 -p "Press any key to return to Menu . . ." echo } SCRIPT... (2 Replies)
Discussion started by: Alendrin
2 Replies

10. Shell Programming and Scripting

scripting for menu

Hi, I'm writting a script to filter a cvs log and get only the modified files to move them to a specific directory to compile. I try to filter a line and move from source to target, with no results. Could you help me? for example, in the cvs log file appears: cat log.txt U... (2 Replies)
Discussion started by: Manu
2 Replies
Login or Register to Ask a Question