/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1992-2011 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* David Korn
* AT&T Bell Laboratories
*
* comm
*/
static const char usage[] =
"[-?\n@(#)$Id: comm (AT&T Research) 1999-04-28 $\n]"
"[+NAME?comm - select or reject lines common to two files]"
"[+DESCRIPTION?\bcomm\b reads two files \afile1\a and \afile2\a "
"which should be ordered in the collating sequence of the "
"current locale, and produces three text columns as output:]{"
"[+1?Lines only in \afile1\a.]"
"[+2?Lines only in \afile2\a.]"
"[+3?Lines in both files.]"
"}"
"[+?If lines in either file are not ordered according to the collating "
"sequence of the current locale, the results are not specified.]"
"[+?If either \afile1\a or \afile2\a is \b-\b, \bcomm\b "
"uses standard input starting at the current location.]"
"[1?Suppress the output column of lines unique to \afile1\a.]"
"[2?Suppress the output column of lines unique to \afile2\a.]"
"[3?Suppress the output column of lines duplicate in \afile1\a and \afile2\a.]"
"\n"
"\nfile1 file2\n"
"\n"
"[+EXIT STATUS?]{"
"[+0?Both files processed successfully.]"
"[+>0?An error occurred.]"
"}"
"[+SEE ALSO?\bcmp\b(1), \bdiff\b(1)]"
;
#include <cmd.h>
{
{
{
{
{
}
return(-1);
}
}
else if(comp > 0)
{
{
return(-1);
}
}
else
{
return(-1);
}
}
n = 0;
if(cp2)
{
n = 1;
}
else
{
return(0);
}
/* process the remaining stream */
while(1)
{
if(n)
return(-1);
return(0);
}
/* NOT REACHED */
}
int
{
register char *cp;
for (;;)
{
{
case '1':
continue;
case '2':
continue;
case '3':
continue;
case ':':
break;
case '?':
break;
}
break;
}
if(mode)
{
}
return error_info.errors;
}