Go to main content

マニュアルページ セクション 1: ユーザーコマンド

印刷ビューの終了

更新: 2022年7月27日
 
 

sdiff(1)

名前

sdiff - 2つのファイル間の違いを並べて出力

形式

sdiff [-l] [-s] [-o output] [-w n] filename1 filename2

説明

sdiff は、 diff コマンドの出力を使用して、2 つのファイルの並列リストを作成して、異なっている行を示します。Lines of the two files are printed with a blank gutter between them if the lines are identical, a < in the gutter if the line appears only in filename1, a > in the gutter if the line appears only in filename2, and a | for lines that are different.(「使用例」を参照)。

オプション

–l

Print only the left side of any lines that are identical.

–s

同一行を出力しません。

–o output

引数 outputfilename1filename2 のユーザー制御のマージとして作成された第 3 ファイルの名前として使用します。filename1filename2 の同一行が output にコピーされます。diff が処理した結果を差異の種類によりグループ分けし、出力します。 このとき、この結果は共通のガータキャラクタを共有して表示されます。After printing each set of differences, sdiff prompts the user with a % and waits for one of the following user-typed commands:

l

出力ファイルに左側のカラムを追加

r

出力ファイルに右側のカラムを追加

s

サイレントモードにし、同一行を出力しない

v

サイレントモードを終了

e l

左カラムでのエディタの呼び出し

e r

右カラムでのエディタの呼び出し

e b

左右カラムの連結でのエディタの呼び出し

e

長さ 0 のファイルでのエディタの呼び出し

q

プログラムを終了

エディタの終了時に、結果のファイルを output ファイルの最後に連結します。

–w n

引数 n を出力行の幅として使用。デフォルトの行長は、 130 文字です。

使用例 1 sdiff コマンドの例

sdiff の出力例は、次のとおりです。


x   |   y
a       a
b   <
c   <
d       d
    >   c

環境変数

If any of the LC_* variables (LC_CTYPE, LC_MESSAGES, LC_TIME, LC_COLLATE, LC_NUMERIC, or LC_MONETARY) (see environ(7)) are not set in the environment, the operational behavior of sdiff for each corresponding locale category is determined by the value of the LANG environment variable.LC_ALL が設定されていれば、その内容が LANG 変数やその他の LC_* 変数より優先されます。前述の変数が環境にまったく設定されていなければ、 C ロケールが sdiff の動作を決定します。

LC_CTYPE

sdiff の文字の処理方法を決定します。LC_CTYPE に有効な値が設定されていると、 sdiff は、その ロケール にあった文字を含むテキストやファイル名を表示および処理できます。

属性

属性についての詳細は、マニュアルページの attributes(7) を参照してください。

属性タイプ
属性値
使用条件
system/core-os
CSI
有効

関連項目

ed(1), diff(1), attributes(7), environ(7)