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
TIX(3)							       Tix Built-In Commands							    TIX(3)

NAME
tixOptionMenu - Create and manipulate tixOptionMenu widgets SYNOPSIS
tixOptionMenu pathName ?options? SUPER-CLASS The TixOptionMenu class is derived from the TixLabelWidget class and inherits all the commands, options and subwidgets of its super-class. STANDARD OPTIONS
The OptionMenu widget supports all the standard Tix widget options. See the Tix-Options(n) manual entry for details on the standard Tix widget options. WIDGET-SPECIFIC OPTIONS [-command command] Specifies the command to be called when the -value option of the OptionMenu is changed. The command will be called with one arguments -- the new value of the OptionMenu widget. [-disablecallback disableCallback] A boolean value indicating whether callbacks should be disabled. When set to true, the TCL command specified by the -command option is not executed when the -value of the OptionMenu widget changes. [-dynamicgeometry dynamicGeometry] A boolean value indicating whether the size of the menubutton subwidget should change dynamically to match the width of the currently selected menu entry. If set to false (the default), the the size of the menubutton subwid- get will be wide enough to display every menu entry fully and does not change when the user selects different entries. [-label label] Specifies the string to display as the label of this OptionMenu widget. [-labelside labelSide] Specifies where the label should be dis- played relative to the entry subwidget. Valid options are: top, left, right, bottom, none or acrosstop. [-state state] Specifies the whether the OptionMenu widget is normal or disabled. Only the values "normal" and "disabled" are recognized. [-value value] Specifies the value of the OptionMenu. The value of the OptionMenu widget is the name of the item currently displayed by its menubutton subwidget. [-variable variable] Specifies the global variable in which the value of the OptionMenu should be stored. The value of the OptionMenu will be automatically updated when this variable is changed. SUBWIDGETS
Name: menu Class: Menu The menu subwidget, which is popped up when the user press the menubutton subwidget. Name: menubutton Class: Menubutton The menubutton subwidget. DESCRIPTION
The tixOptionMenu command creates a new window (given by the pathName argument) and makes it into a OptionMenu widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the OptionMenu such as its cursor and relief. WIDGET COMMANDS
The tixOptionMenu command creates a new Tcl command whose name is the same as the path name of the OptionMenu's window. This command may be used to invoke various operations on the widget. It has the following general form: pathName option ?arg arg ...? PathName is the name of the command, which is the same as the OptionMenu widget's path name. Option and the args determine the exact behav- ior of the command. The following commands are possible for OptionMenu widgets: pathName add type name ?option value ...? Adds a new item into the OptionMenu widget. type must be either command or separator. The options may be any of the valid options for the command or separator menu entry types for the TK menu widget class, except -command. pathName cget option Returns the current value of the configuration option given by option. Option may have any of the values accepted by the tixOption- Menu command. pathName configure ?option? ?value option value ...? Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the tixOptionMenu command. pathName delete name Deletes the menu entry identified by name. pathName disable name Disables the menu entry identified by name. pathName enable name Enables the menu entry identified by name. pathName entrycget name option Returns the current value of the configuration option given by option in the menu entry identified by name. Option may have any of the values accepted by the add widget command. pathName entryconfigure name ?option? ?value option value ...? Query or modify the configuration options of the menu entry identified by name. If no option is specified, returns a list describing all of the available options for the menu entry (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corre- sponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the add widget command. pathName entries Returns the names of all the entries currently in the OptionMenu widget. pathName subwidget name ?args? When no options are given, this command returns the pathname of the subwidget of the specified name. When options are given, the widget command of the specified subwidget will be called with these options. KEYWORDS
Tix(n) Tix 4.0 TIX(3)
All times are GMT -4. The time now is 10:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy