Search Results

Search: Posts Made By: Generic
6,324
Posted By Generic
Thanks for the reply, my current code: ...
Thanks for the reply, my current code:


elif [ "$1" == "-r" ]
then
echo "Enter the new name: "
read name
echo "Enter the new address: "
read address
echo "Enter the new phone number: "...
6,324
Posted By Generic
It seems like I have tried every possible thing....
It seems like I have tried every possible thing. :( when I do exactly what you suggested it just acts like a cat (when the user is inputing information, it keeps going until i press ctrl+d). If I...
6,324
Posted By Generic
Thanks for the reply, i really do appreciate all...
Thanks for the reply, i really do appreciate all help.

I couldnt get that to work though, as i encountered many different problems

I currently have:

#delete the line that include the name...
6,324
Posted By Generic
thanks very much for the reply line = $(grep...
thanks very much for the reply

line = $(grep $2 dirInfo) #Gives the error: line: command not found
line = 'grep $2 dirInfo' #Gives the error: line: command not found

Is there a different...
6,324
Posted By Generic
elif [ "$1" == "-r" ] then echo "Enter the...
elif [ "$1" == "-r" ]
then
echo "Enter the new name: "
read name
echo "Enter the new address: "
read address
echo "Enter the new phone number: "
read phonenumber
#ERROR line = 'grep $2...
6,324
Posted By Generic
WOW thank you so much! Is there any way to edit...
WOW thank you so much! Is there any way to edit it in my code so I dont have to put the quotation marks in the input?
6,324
Posted By Generic
yes i believe so. #Doesnt Work elif [...
yes i believe so.


#Doesnt Work
elif [ "$1" == "-p" ]
then
grep "$2" dirInfo


-bash-2.05b$ ./phonebook -p (324)343-3421
-bash: syntax error near unexpected token `('

It seems as though...
6,324
Posted By Generic
Thank you so much for your reply. Sorry about...
Thank you so much for your reply. Sorry about the spelling!

To check the last name (input is the first letter) this worked!:
grep '^'"$2" dirInfo

One of my biggest questions is why the grep...
6,324
Posted By Generic
Project with somewhat simple bourne shell cript..
Right now if I have a file that has the following information (with : as the delimiter)

name :address :phone number

I need to be able to do the following commands:
-n search for a name
-p ...
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 03:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy