Date: Thu, 31 Jan 2002 23:50:13 +0800 (CST) From: =?iso-8859-1?q?adrian=20kok?= <adriankok2000@yahoo.com.hk> To: freebsd-questions@FreeBSD.ORG Subject: compare two files Message-ID: <20020131155013.82668.qmail@web21209.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
I would like to know how to write script or program to compare two file two files: file1 and file2 check data of file1 whether exists in file2 if not write this data in file1 or output to file #!/bin/sh $lista=fopen("a.txt", "r"); $listb=fopen("b.txt", "r"); while(!feof($lista)) { $dmbuffer = fgets ($lista); grep $dmbuffer $listb > diff; } Could you teach me or where can I get this information from website TIA _______________________________________________________________________ Do You Yahoo!? Get your free @yahoo.com.hk address at http://mail.english.yahoo.com.hk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020131155013.82668.qmail>