![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help mounting a phone! | Danny Fozard | BSD | 2 | 01-09-2008 08:15 PM |
| Phone Dialer? | andrewgray | UNIX for Dummies Questions & Answers | 0 | 08-27-2005 09:40 PM |
| Phone dialer? | Sonshyne5 | UNIX for Advanced & Expert Users | 10 | 07-17-2003 03:01 PM |
| Phone Directory | MaRk2002 | Shell Programming and Scripting | 3 | 01-28-2002 06:41 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Phone menu
Hello,
Is there a way to read in user input inside a Here Document? The last line of the add(draft) file is supposed to redirect the user input to the phonebook file, but it is not doing that. I am not sure what I am doing wrong. So the redirected user input should be appended to the end of the phonebook file. The display file should perform a search for the keyword(s) that the user inputs. Once again, I am not sure what I am missing or doing wrong. # Menu file clear=`tput clear` bold=`tput bold` bell=`tput bel` off=`tput sgr0` export clear bold bell off cat<<alldone1 ${bold} WELCOME TO MENU PROGRAM OF THE PHONEBOOK ${off} alldone1 cat<<alldone2 Press ${bold}A${off} to add information to the phonebook. Press ${bold}C${off} to change phonebook information. Press ${bold}D${off} to display phonebook information. Press ${bold}R${off} to remove phonebook information. Press ${bold}Q${off} to quit the phonebook. alldone2 read choice cat<<alldone3 ${bell} You have chosen $choice. alldone3 if [ "$choice" = "a" ] || [ "$choice" = "A" ] then echo "Add" add elif [ "$choice" = "c" ] || [ "$choice" = "C" ] then echo "Change" elif [ "$choice" = "d" ] || [ "$choice" = "D" ] then echo "Display" elif [ "$choice" = "r" ] || [ "$choice" = "R" ] then echo "Remove" elif [ "$choice" = "q" ] || [ "$choice" = "Q" ] then echo "Quit" fi ############################################################# # add (draft) file clear=`tput clear` bold=`tput bold` bell=`tput bel` off=`tput sgr0` export clear bold bell off cat<<alldone1 ${clear} ${bell} ${bold} WELCOME TO ADD PROGRAM OF THE PHONEBOOK ${off} ${bell} Enter the person's name: alldone1 read name cat<<alldone2 ${bell} Enter the person's address: (Street address or mailing address) alldone2 read address cat<<alldone3 ${bell} Enter the person's city: alldone3 read city cat<<alldone4 ${bell} Enter the person's state: alldone4 read state cat<<alldone5 ${bell} Enter the person's zip code: (Five or nine digits) alldone5 read zipCode cat<<alldone6 ${bell} Enter the person's phone number: (Please include the area code) alldone6 read phoneNumber cat<<alldone7 ${bell} $name:$address:$city:$state:$zipCode:$phoneNumber >> phonebook ############################################################## # phonebook file clear=`tput clear` bold=`tput bold` bell=`tput bel` off=`tput sgr0` export clear bold bell off cat<<alldone1 ${bold} WELCOME TO PHONEBOOK PROGRAM OF THE PHONEBOOK ${off} The format for phonebook entries is: name:address:city:state:zipCode honeNumber alldone1 ################################################################ # display file clear=`tput clear` bold=`tput bold` bell=`tput bel` off=`tput sgr0` export clear bold bell off cat<<alldone1 ${bold} WELCOME TO DISPLAY PROGRAM OF THE PHONEBOOK ${off} alldone1 cat<<alldone2 ${bell} ${bold} Please enter your search keyword(s): ${off} alldone2 read keywords ${bell} grep -i $keywords phonebook |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|