Sponsored Content
Full Discussion: Telephone book script
Homework and Emergencies Homework & Coursework Questions Telephone book script Post 302796063 by Jagst3r21 on Thursday 18th of April 2013 11:34:01 PM
Old 04-19-2013
Telephone book script

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:

Hi, here is my other assignment for the week.

Create a shell script for a telephone book application. Display a menu for the following functions.

1. Add an entry----done
2. Display all matches to a string----done
3. Sort and display the file
4. Delete all entries that match a string----done
5. exit the program

Using the phone list below:

• Add a new name to the phone book file
• Display all matches to a name or phone number
• Sort the phone book file by last name
• Delete an entry

Print the results from each sequence of commands

Data File (tabs between fields)
Gene Smith 732 946-4691
Henry Brown 908 922-5820
Harry Crown 609 566-4515
Jim Zark 732 842-1910
Tom Mann 908 264-5321
Jack Spratt 908 264-4816
Joe Bram 609 521-4841



2. Relevant commands, code, scripts, algorithms:

shell programming

3. The attempts at a solution (include all code and scripts):

Code:
#!/bin/sh
    # Name of phonebook
    BOOK="phonebook.txt"

    exit=0

    while [ $exit -ne 1 ]
    do
        echo "operation you want?"
        echo -e "add, list, find, delete, exit: "
        read answer

        if [ "$answer" = "add" ]
        then
            ./add.sh
        elif [ "$answer" = "list" ]
        then
            ./list.sh
        elif [ "$answer" = "find" ]
        then
            ./find.sh
        elif [ "$answer" = "delete" ]
        then
            ./delete.sh
        elif [ "$answer" = "exit" ]
        then
            exit=1
        else
            echo "command not available."
        fi
    done

    exit 0

4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

Brookdale Community College - Lincroft, New Jersey - United States - Dr. Rick Bournique- COMP 145


Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
 

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
PHONE(1)						      General Commands Manual							  PHONE(1)

NAME
phone - Phone utility for DECnet SYNOPSIS
phone [options] Options: [-vVh] [-s switchhook char] [initial command] DESCRIPTION
phone is a program that allows the user to communicate interactively with users on VMS systems. Two user interfaces are available: X-Win- dows (GTK+) and terminal (ncurses). If X-Windows is available and compiled into phone then it will be used unless the -n flag is present on the command line. After entering the phone command you will be presented with the phone screen which has windows for the chat and a command-line at the top. If you are not talking to another user then you can enter commands directly, otherwise you will need to precede commands with the 'switch hook' character, which defaults to the percent sign (%). You can also enter a command for phone on the shell command-line. This command will be executed when phone starts up. This makes it conve- nient to enter commands such as: 'phone answer' or 'phone marsha::chrissie' In command mode phone understands several commands: DIAL <node::user> Call a user ANSWER Answer an incoming call REJECT Reject an incoming call EXIT or QUIT Return the the command prompt HOLD Hold all callers UNHOLD Unhold callers HANGUP Hangup the phone DIR <node> Show users logged into <node> FACSIMILE <file> Send <file> HELP Show this help All commands (apart from QUIT and EXIT) can be abbreviated to 3 characters and all (really all this time) commands are case insensitive. OPTIONS
-h -? Displays help for using the command. -V Show the version of phone. -s Set the switch hook character. This is the character used to switch from talking to another user and entering PHONE commands when using the terminal interface.x -n Disables use of the X-windows user interface. Use this to run phone in an xterm. SEE ALSO
phoned(8) DECnet utilities March 26 1999 PHONE(1)
All times are GMT -4. The time now is 11:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy