shell script problem

I have one file list.fdict which contains recordname and its details.

like :

NAME1:25:C:NAME LINE1:
NAME2:25:C:NAME LINE2:
CITY:25:C:City:
STATE:2:C:State:
ZIPCODE:5:N:ZIPCODE:
PHONE1:12:C:HOME PHONE:
PHONE2:12:C:BUSINESS PHONE:
I want to append news records(22 different records line) to the above file.
for this,
I want to write shell script which first check record exists then dont append
and if not exists then append it.

How do you I write such shell script in efficient way.

Regards,
Amit

I m changing my problem stateemnt little.

suppose I have two files list1.cfg and list2.cfg
both files contains differentrecords details
like
List1.cfg
NAME1:25:C:NAME LINE1:
NAME2:25:C:NAME LINE2:
CITY:25:C:City:
STATE:2:C:State:
ZIPCODE:5:N:ZIPCODE:
PHONE1:12:C:HOME PHONE:
PHONE2:12:C:BUSINESS PHONE:

list2.cfg
NAME1:25:C:NAME LINE1:
NAME2:25:C:NAME LINE2:
PHONECNTR:2:N:Number of attemmpts at calling RECALLNUMBER
PHONESTATR:1:C:PHONESTAT of the current RECALLNUMBER
ZONEPHONER:1:C:Time zone of the current RECALLNUMBER
LASTDATER:10:D:Date of last attempt on RECALLNUMBER
LASTTIMER:8:T:Time of last attempt on RECALLNUMBER
LASTSTATR:2:C:Stat of last attempt on RECALLNUMBER
FRSTDATER:10:D:Date of first attempt to call RECALLNUMBER
FRSTTIMER:8:T:Time of first attempt to call RECALLNUMBER
FRSTSTATR:2:C:Stat of first attempt to call RECALLNUMBER

Now I want to append contents list2.cfg to list1.cfg(It ispposible using cat list2.cfg >>list1.cfg) but I want to check if content of (record) in list2.cfg is present in list1.cfg then dont append it otherwise append it.

How do I write such shell script in efficient way
Regards,
Amit

Please put such things in [ code ] tags. like [ code ] example [ /code ] except without the extra spaces in the tags. This should prevent :smiley: from being a smiley:

:D

Hi,

to show you the lines in only in file2 but not in file1, try:

comm -13 file1 file2

and to append them to file1

comm -13 file1 file2 >> file1

HTH Chris