This is a pretty simple program. You could easily add features, but the only command you need is echo.
Yes, echo.
Make a shell script with the following:
Code:
#!/bin/sh
# $1 = first name
# $2 = last name
# $3 = phone number
echo "$1 $2 $3"
On the command line, type...
filename firstname lastname phonenumber >> phone_dir
You shouldn't use a shell script for this. Its not needed.
If you want to check for repeated phone numbers, read the man pages on uniq and sort.
Also, there is a great guide (The Advanced Bash Scripting Guide) on
www.tldp.org
There Is More Than One Way To Do It.