diff options
Diffstat (limited to 'documentation/manual-pages/ja/man1/cmp.1')
-rw-r--r-- | documentation/manual-pages/ja/man1/cmp.1 | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/documentation/manual-pages/ja/man1/cmp.1 b/documentation/manual-pages/ja/man1/cmp.1 new file mode 100644 index 0000000000..758ce1e4a4 --- /dev/null +++ b/documentation/manual-pages/ja/man1/cmp.1 @@ -0,0 +1,119 @@ +.\" 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 +.\" %FreeBSD: src/usr.bin/cmp/cmp.1,v 1.12 2002/12/30 21:18:11 schweikh Exp % +.\" $FreeBSD$ +.\" +.Dd June 6, 1993 +.Dt CMP 1 +.Os +.Sh 名称 +.Nm cmp +.Nd 2 つのファイルを比較する +.Sh 書式 +.Nm cmp +.Op Fl l | Fl s | Fl x +.Op Fl z +.Ar file1 file2 +.Op Ar skip1 Op Ar skip2 +.Sh 解説 +.Nm +ユーティリティは、2つのファイル内容を比較して、その結果を標準出力に出力します。 +ファイル内容が一致していれば、デフォルトでは +.Nm +は何も表示しません。ファイル内容に違いがあった場合は、最初に +違いが見つかった場所の、 +バイト位置と行番号を出力します。 +.Pp +バイト位置と行番号は、1 から数え始めます。 +.Pp +オプションは以下のものがあります: +.Bl -tag -width Ds +.It Fl l +全ての違いに対し、 +違いのあった場所のファイル先頭からのバイト位置 (10 進数表現) と、 +各々のファイル中の値 (8 進数表現) を表示します。 +.It Fl s +何も表示しないようにします。結果は終了コードにのみ反映されます。 +.It Fl x +.Fl l +と似ていますが、16 進数で表示し、 +ファイルの最初のバイトに対して 0 をインデックスとして使用します。 +.It Fl z +通常ファイルに対しては、ファイルの大きさをまず比較し、 +異なる場合には比較を失敗させます。 +.El +.Pp +.Ar file1 +と +.Ar file2 , +の開始バイト位置を +.Ar skip1 +と +.Ar skip2 +を使って、各々指定して比較することができます。 +この値は 10 進数表記がデフォルトで、先頭に ``0x'' か ``0'' があると、 +16 進数や 8 進数表現と解釈されます。 +.Pp +.Nm +は、戻り値として以下の値のうちの一つをとります: +.Bl -tag -width 4n +.It 0 +ファイル内容が一致した。 +.It 1 +ファイル内容に違いがあったか、どちらかのファイルが先に +ファイルエンドに達した。 +後者の場合、 +.Fl s +オプションが指定されていない場合には、 +.Nm +は、短い方のファイルで (違いが見付かる前に) +EOF に到達したことを標準エラー出力に出力します。 +.It >1 +エラーが起きた。 +.El +.Sh 関連項目 +.Xr diff 1 , +.Xr diff3 1 +.Sh 規格 +.Nm +は +.St -p1003.2 +準拠です。 +.Sh 歴史 +.Nm +コマンドは +.At v1 +から登場しました。 |