summaryrefslogtreecommitdiff
path: root/ja/man/man1/cmp.1
diff options
context:
space:
mode:
Diffstat (limited to 'ja/man/man1/cmp.1')
-rw-r--r--ja/man/man1/cmp.1111
1 files changed, 111 insertions, 0 deletions
diff --git a/ja/man/man1/cmp.1 b/ja/man/man1/cmp.1
new file mode 100644
index 0000000000..3f27f74029
--- /dev/null
+++ b/ja/man/man1/cmp.1
@@ -0,0 +1,111 @@
+.\" Copyright (c) 1987, 1990, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the Institute of Electrical and Electronics Engineers, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)cmp.1 8.1 (Berkeley) 6/6/93
+.\" %Id: cmp.1,v 1.2.2.1 1997/06/27 06:16:30 charnier Exp %
+.\" jpman %Id: cmp.1,v 1.2 1997/03/26 15:40:44 horikawa Stab %
+.\"
+.Dd June 6, 1993
+.Dt CMP 1
+.Os
+.Sh 名称
+.Nm cmp
+.Nd 2 つのファイルを比較する
+.Sh 書式
+.Nm cmp
+.Op Fl l | Fl s
+.Ar file1 file2
+.Op Ar skip1 Op Ar skip2
+.Sh 解説
+.Nm cmp
+ユーティリティは、2つのファイル内容を比較して、その結果を標準出力に出力します。
+ファイル内容が一致していれば、デフォルトでは
+.Nm cmp
+は何も表示しません。ファイル内容に違いがあった場合は、最初に
+違いが見つかった場所の、
+バイト位置と行番号を出力します。
+.Pp
+バイト位置と行番号は、1 から数え始めます。
+.Pp
+オプションは以下のものがあります:
+.Bl -tag -width Ds
+.It Fl l
+全ての違いに対し、
+違いのあった場所のファイル先頭からのバイト位置 (10進数表現) と、
+各々のファイル中の値 (8進数表現) を表示します。
+.It Fl s
+何も表示しないようにします。結果は終了コードにのみ反映されます。
+.El
+.Pp
+.Ar file1
+と
+.Ar file2 ,
+の開始バイト位置を
+.Ar skip1
+と
+.Ar skip2
+を使って、各々指定して比較することができます。
+この値は 10 進数表記がデフォルトで、先頭に ``0x'' か ``0'' があると、
+16 進数や 8 進数表現と解釈されます。
+.Pp
+.Nm cmp
+は、戻り値として以下の値のうちの一つをとります:
+.Bl -tag -width 4n
+.It 0
+ファイル内容が一致した。
+.It 1
+ファイル内容に違いがあったか、どちらかのファイルが先に
+ファイルエンドに達した。
+後者の場合、
+.Fl s
+オプションが指定されていない場合には、
+.Nm cmp
+は、短い方のファイルで(違いが見付かる前に)
+EOF に到達したことを標準出力に出力します。
+.It >1
+エラーが起きた。
+.El
+.Sh 関連項目
+.Xr diff 1 ,
+.Xr diff3 1
+.Sh 規格
+.Nm cmp
+は
+.St -p1003.2
+準拠です。
+.Sh 歴史
+.Nm cmp
+コマンドは
+.At v1
+から登場しました。