Sponsored Content
Full Discussion: Telephone book script
Homework and Emergencies Homework & Coursework Questions Telephone book script Post 302797047 by Jagst3r21 on Sunday 21st of April 2013 08:37:33 PM
Old 04-21-2013
I have been trying to replicate this with a case statement because I am not sure which way he wants this. He has an example of creating a menu in our powerpoint slides, so he might want us to do it that way, but I cannot figure out how to add the commands properly. Would it be something like:

Code:
# Use of a case statement to offer a 5 item menu
echo “  Menu\n1. Add an entry \n2. Display all matches to a string\n3. Sort and display the file\n4. Delete all entries that match a string\n5. Quit to Unix\nEnter your option #: \c”
read choice
case “$choice” in
	1) add;;
	2) list;;
	3) find;;
	4) delete;;
	5) exit ;;
	*)	echo “Invalid option”   # ;; not needed for last option
esac

I am not sure how to add the commands properly like I did with the original solution, where I included the sub scripts like ./add.sh. Any ideas?
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

telephone working in unix

sir, i came to know that telephone exchanges use unix for the working of telephones,that is when we take our hand set in telephone we can note a dial sound,for this telephone exchanges use unix. we are going to do project using unix,i want to know wheater we can able to connect... (1 Reply)
Discussion started by: radheesh
1 Replies

2. IP Networking

all about telephone in unix

hai to all, that i came to know all telephone exchanges use unix.i want to know wheather we can connect telephones uaeing unix,if it possible means how&and also i need about more information about "telephones in unix" ... (1 Reply)
Discussion started by: radheesh
1 Replies

3. UNIX for Dummies Questions & Answers

Got connected with Modem but cannot dial Telephone no. to connect to host

Hello There, I configure my Modem as follow. Step1. # admintool & Then from Browse --> Serial Port i select tta port and Edit --> Modify From that i select Template : Modem:Dial Out Baud Rate: 9600 Ok Step 2 # tip /dev/cua/a connected (1 Reply)
Discussion started by: abidmalik
1 Replies

4. Shell Programming and Scripting

Sobell Book script

hey peeps has anyone done the "Enhance the spell_check script (Sobell page 646) to accept an optional third argument" script. I am fully having trouble getting it to work. if you have done the script and dont mind sharing with others, please help me out. thanks mila :confused: (0 Replies)
Discussion started by: 30177005
0 Replies

5. Shell Programming and Scripting

Script for converting a pdf to book format

Hello, excuse my English... I'm trying to do a nautilus-script to transform a normal A4 pdf to another pdf with book format, ready to be printed (double sided). I mean, the script put pages in order and also put 2 pages per horizontal A4 page (p.e.: a pdf with 8 pages would look like: 8-1, 2-7,... (2 Replies)
Discussion started by: dokan
2 Replies

6. Shell Programming and Scripting

Typo in sample script from book?

Hello, I'm new to this forum, and I apologize in advance if I did something wrong here. I am pretty stumped here as I am still getting the error message, "./comc1.sh: test: argument expected." after executing the script itself. Here's the script file I modified: I tried executing line 4... (1 Reply)
Discussion started by: ConcealedKnight
1 Replies

7. Shell Programming and Scripting

Telephone Format and Check

How can I script to check telephone number entered by user in a uniz script: print -n "Enter telephone number to check ? " ; read telno How do I script to : 1) Check if entered without dashes or with dashes 2) If without dashes how can I check: if telno is only 10... (2 Replies)
Discussion started by: mrn6430
2 Replies
MENU_DRIVER(3)						   BSD Library Functions Manual 					    MENU_DRIVER(3)

NAME
menu_driver -- main menu handling function LIBRARY
Curses Menu Library (libmenu, -lmenu) SYNOPSIS
#include <menu.h> int menu_driver(MENU *menu, int c); DESCRIPTION
The menu_driver() function is the guts of the menu system. It takes the commands passed by c parameter and performs the requested action on the menu given. The following commands may be given to the menu driver: Command Action REQ_LEFT_ITEM Sets the new current item to be the item to the left of the current item. REQ_RIGHT_ITEM Sets the new current item to be the item to the rights of the current item. REQ_UP_ITEM Sets the new current item to be the item above the current item. REQ_DOWN_ITEM Sets the new current item to be the item below the current item. REQ_SCR_ULINE Scroll the menu one line towards the bottom of the menu window. The new current item becomes the item immediately above the current item. REQ_SCR_DLINE Scroll the menu one line towards the top of the menu window. The new current item becomes the item immediately below the current item. REQ_SCR_DPAGE Scroll the menu one page towards the bottom of the menu window. REQ_SCR_UPAGE Scroll the menu one page towards the top of the menu window. REQ_FIRST_ITEM Set the current item to be the first item in the menu. REQ_LAST_ITEM Set the current item to be the last item in the menu. REQ_NEXT_ITEM Set the new current item to be the next item in the item array after the current item. REQ_PREV_ITEM Set the new current item to be the item before the current item in the items array. REQ_TOGGLE_ITEM If the item is selectable then toggle the item's value. REQ_CLEAR_PATTERN Clear all the characters currently in the menu's pattern buffer. REQ_BACK_PATTERN Remove the last character from the pattern buffer. REQ_NEXT_MATCH Attempt to find the next item that matches the pattern buffer. REQ_PREV_MATCH Attempt to find the previous item that matches the pattern buffer. If menu_driver() is passed a command that is greater than MAX_COMMAND then the command passed is assumed to be a user defined command and menu_driver() returns E_UNKNOWN_COMMAND. Otherwise if the command is a printable character then the character represented by the command is placed at the end of the pattern buffer and an attempt is made to match the pattern buffer against the items in the menu. RETURN VALUES
The functions return one of the following error values: E_OK The function was successful. E_SYSTEM_ERROR There was a system error during the call. E_BAD_ARGUMENT One or more of the arguments passed to the function was incorrect. E_NOT_POSTED The menu is not posted. E_UNKNOWN_COMMAND The menu driver does not recognize the request passed to it. E_NO_MATCH The character search failed to find a match. E_NOT_CONNECTED The item is not connected to a menu. E_REQUEST_DENIED The menu driver could not process the request. SEE ALSO
curses(3), menus(3) NOTES
The header <menu.h> automatically includes both <curses.h> and <eti.h>. BSD
September 10, 1999 BSD
All times are GMT -4. The time now is 06:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy