Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cmp(1) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                   cmp(1)



        _________________________________________________________________
        cmp                                                       Command
        compare two files
        _________________________________________________________________


        SYNTAX

        cmp [ -l ] [ -s ] file1 file2


        DESCRIPTION

        Cmp compares two files.  (If file1 is -, the standard input is
        used.) Under all options, cmp makes no comment if the files are
        the same.  If the files differ, cmp announces the byte and line
        number where the difference occurred.  If one file is an initial
        subsequence of the other, that fact is noted.

        Options:

        -l    Print the byte number (decimal) and the differing bytes
              (octal) for each difference.

        -s    Print nothing for differing files; return codes only.  If
              the files are the same, cmp prints nothing.



        _________________________________________________________________
        EXAMPLES

        $ cmp -l oldmembers currentmembers

        This example will compare the file "old_members" with the file
        "current_members" and report all differences.

        $ cmp -s allowed users

        This example will compare the file "allowed" with the file
        "users" and return a standard exit code but no other output.
        This is useful to compare two files then test the exit code in a
        shell script.
        _________________________________________________________________


        SEE ALSO

        comm(1), diff(1).





        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                                   cmp(1)



        DIAGNOSTICS

        Exit code 0 is returned for identical files, 1 for different
        files, and 2 for an inaccessible file or missing argument.


















































        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026