Guest_imported
New member
- Jan 1, 1970
- 0
- 0
- 0
i have this coding, where i am trying to search to see in a name already exists in the .phonebook file
if it does, return an error message.
if it doesnt, add the name to the database.
here is my code in C shell:
echo -n "FirstName: "
set first = $<
echo -n "LastName: "
set last = $<
if (fgrep $last .phonebook > /dev/null) then
echo -n "**ERROR**"
else
printf "%s:%s:::\n" $first $last >> .phonebook
endif
//this gives me an if syntax error, but i dont see why
this code is nested already in another if statment, but it should still work...
any suggestions??
thanks,
jada20
if it does, return an error message.
if it doesnt, add the name to the database.
here is my code in C shell:
echo -n "FirstName: "
set first = $<
echo -n "LastName: "
set last = $<
if (fgrep $last .phonebook > /dev/null) then
echo -n "**ERROR**"
else
printf "%s:%s:::\n" $first $last >> .phonebook
endif
//this gives me an if syntax error, but i dont see why
this code is nested already in another if statment, but it should still work...
any suggestions??
thanks,
jada20