'\" te .\" Copyright 1989 AT&T .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. .TH fgrep 1 "2010 年 3 月 23 日" "SunOS 5.11" "ユーザーコマンド" .SH 名前 fgrep \- ファイル内の固定文字列のみを検索 .SH 形式 .LP .nf \fB/usr/bin/fgrep\fR [\fB-bchilnsvx\fR] \fB-e\fR \fIpattern_list\fR [\fIfile...\fR] .fi .LP .nf \fB/usr/bin/fgrep\fR [\fB-bchilnsvx\fR] \fB-f\fR \fIfile\fR [\fIfile...\fR] .fi .LP .nf \fB/usr/bin/fgrep\fR [\fB-bchilnsvx\fR] \fIpattern\fR [\fIfile...\fR] .fi .LP .nf \fB/usr/xpg4/bin/fgrep\fR [\fB-bchilnqsvx\fR] \fB-e\fR \fIpattern_list\fR [\fB-f\fR \fIfile\fR] [\fIfile...\fR] .fi .LP .nf \fB/usr/xpg4/bin/fgrep\fR [\fB-bchilnqsvx\fR] [\fB-e\fR \fIpattern_list\fR] \fB-f\fR \fIfile\fR [\fIfile...\fR] .fi .LP .nf \fB/usr/xpg4/bin/fgrep\fR [\fB-bchilnqsvx\fR] \fIpattern\fR [\fIfile...\fR] .fi .SH 機能説明 .sp .LP \fBfgrep\fR (固定 \fBgrep\fR) ユーティリティーは、ファイルで文字列を検索し、その文字列を含むすべての行を出力します。\fBfgrep\fR は文字列を検索するため、式に一致するパターンを検索する \fBgrep\fR(1) や \fBegrep\fR(1) とは異なります。 .sp .LP \fB$\fR、\fB*\fR、\fB[\fR、\fB^\fR、|、\fB(\fR、\fB)\fR、および \fB\\fR の文字は、 \fBfgrep\fR により文字どおりに解釈されます。すなわち、\fBfgrep\fR は、\fBegrep\fR の場合と異なり、正規表現をすべて認識できるわけではありません。 これらの文字はシェルに対して特別の意味を持ちます。そのため、安全を期すために、全 \fIstring\fR を単一引用符 (\fB´\fR) で囲むことをお勧めします。 .sp .LP ファイルを何も指定しないと、 \fBfgrep\fR は標準入力を想定します。通常、発見された各行は標準出力にコピーされます。複数の入力ファイルがある場合、表示された各行の前にファイル名が出力されます。 .SH オプション .sp .LP 次のオプションは、 \fB/usr/bin/fgrep\fR と \fB/usr/xpg4/bin/fgrep\fR の両方のコマンドでサポートされています。 .sp .ne 2 .mk .na \fB\fB-b\fR\fR .ad .RS 19n .rt 各行の先頭に、その行が発見されたブロック番号を出力します。これは、ブロック番号を文脈別に見つける際に役立ちます。最初のブロックは 0 です。 .RE .sp .ne 2 .mk .na \fB\fB-c\fR\fR .ad .RS 19n .rt パターンを含む行の数だけを出力します。 .RE .sp .ne 2 .mk .na \fB\fB-e\fR \fIpattern_list\fR\fR .ad .RS 19n .rt \fIpattern_list\fR にある \fIstring\fR を検索します。これは、\fIstring\fR が \fB-\fR ではじまる場合に有効です。 .RE .sp .ne 2 .mk .na \fB\fB-f\fR \fIpattern-file\fR\fR .ad .RS 19n .rt \fIpattern–file\fR からパターンのリストを取り出します。 .RE .sp .ne 2 .mk .na \fB\fB-h\fR\fR .ad .RS 19n .rt 複数のファイルを検索するときにファイルの出力を抑制します。 .RE .sp .ne 2 .mk .na \fB\fB-i\fR\fR .ad .RS 19n .rt 比較中に大文字と小文字の区別を無視します。 .RE .sp .ne 2 .mk .na \fB\fB-l\fR\fR .ad .RS 19n .rt 一致する行のあるファイルの名前を 1 行ずつ復帰改行文字で区切って出力します。パターンが 2 度以上見つかるときは、ファイルの名前を繰り返しません。 .RE .sp .ne 2 .mk .na \fB\fB-n\fR\fR .ad .RS 19n .rt 各行の先頭に、その行のファイル中の行番号を出力します。最初の行は 1 です。 .RE .sp .ne 2 .mk .na \fB\fB-s\fR\fR .ad .RS 19n .rt エラーメッセージを表示するだけです。エラーステータスをチェックするのに有用です。 .RE .sp .ne 2 .mk .na \fB\fB-v\fR\fR .ad .RS 19n .rt パターンを含む行を除いたすべての行を出力します。 .RE .sp .ne 2 .mk .na \fB\fB-x\fR\fR .ad .RS 19n .rt 完全に一致する行だけを出力します。 .RE .SS "/usr/xpg4/bin/fgrep" .sp .LP 次のオプションは、\fB/usr/xpg4/bin/fgrep\fR のみでサポートされています。 .sp .ne 2 .mk .na \fB\fB-q\fR\fR .ad .RS 6n .rt 非出力。行が一致したかどうかに関わらず、 標準出力には何も書き出しません。入力行に一致した行があった場合、 0 の終了ステータスで処理を終了します。 .RE .SH オペランド .sp .LP 次のオペランドがサポートされています。 .sp .ne 2 .mk .na \fB\fIfile\fR\fR .ad .RS 8n .rt パターンを検索するファイルのパス名を指定します。\fIfile\fR を指定しないと、標準入力が読み込まれます。 .RE .SS "/usr/bin/fgrep" .sp .ne 2 .mk .na \fB\fIpattern\fR\fR .ad .RS 11n .rt 入力の検索時に用いるパターンを指定します。 .RE .SS "/usr/xpg4/bin/fgrep" .sp .ne 2 .mk .na \fB\fIpattern\fR\fR .ad .RS 11n .rt 入力の検索時に用いる 1 つまたは複数のパターンを指定します。オペランドは \fB-e\fR \fIpattern_list\fR が指定されたものとして扱われます。 .RE .SH 使用法 .sp .LP ファイルが 2 ギガバイト (2^31 バイト) 以上ある場合の \fBfgrep\fR の動作については、 \fBlargefile\fR(5) を参照してください。 .SH 環境 .sp .LP \fBfgrep\fR の実行に影響を与える次の環境変数についての詳細は、\fBenviron\fR(5) を参照してください。\fBLC_COLLATE\fR、\fBLC_CTYPE\fR、\fBLC_MESSAGES\fR、および \fBNLSPATH\fR。 .SH 終了ステータス .sp .LP 次の終了ステータスが返されます。 .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 5n .rt 一致するものが 1 つ以上見つかりました。 .RE .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .RS 5n .rt 一致するものが 1 つも見つかりませんでした。 .RE .sp .ne 2 .mk .na \fB\fB2\fR\fR .ad .RS 5n .rt 構文エラーが検出された、 またはアクセスできないファイルがあった (一致するものが見つかった場合でも) 。 .RE .SH 属性 .sp .LP 属性についての詳細は、マニュアルページの \fBattributes\fR(5) を参照してください。 .SS "/usr/bin/fgrep" .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . 属性タイプ属性値 _ 使用条件system/core-os .TE .SS "/usr/xpg4/bin/fgrep" .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . 属性タイプ属性値 _ 使用条件system/xopen/xcu4 _ CSI有効 .TE .SH 関連項目 .sp .LP \fBed\fR(1), \fBegrep\fR(1), \fBgrep\fR(1), \fBsed\fR(1), \fBsh\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBXPG4\fR(5) .SH 注意事項 .sp .LP 理想的には \fBgrep\fR コマンドを 1 つだけにすべきなのですが、 空間と時間を調節できるだけの広範なアルゴリズムはありません。 .sp .LP 1 行は仮想記憶に使用できるサイズに 制限されています。 .SS "/usr/xpg4/bin/fgrep" .sp .LP \fB/usr/xpg4/bin/fgrep\fR ユーティリティーは \fB/usr/xpg4/bin/grep\fR \fB-F\fR と同じです (\fBgrep\fR(1) 参照) 。 移植性が必要なアプリケーションでは \fB/usr/xpg4/bin/grep\fR \fB-F\fR を使用してください。