sdiff - 并排输出两个文件的差异
sdiff [-l] [-s] [-o output] [-w n] filename1 filename2
sdiff 会使用 diff 命令的输出来生成两个文件的并排列表,以指示不同的行。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.(请参见下文的“示例”部分。)
Print only the left side of any lines that are identical.
不输出相同的行。
使用参数 output 作为第三个文件的名称,而创建该文件是为了在用户控制下合并 filename1 和 filename2。filename1 和 filename2 相同的行将复制到 output。输出 diff 生成的差异集;其中的一个差异集具有相同的列边字符。After printing each set of differences, sdiff prompts the user with a % and waits for one of the following user-typed commands:
将左列附加到输出文件。
将右列附加到输出文件。
启用无提示模式;不输出相同的行。
禁用无提示模式。
使用左列调用编辑器。
使用右列调用编辑器。
使用左列和右列的串联来调用编辑器。
使用零长度文件调用编辑器。
退出程序。
退出编辑器后,得到的文件将串联到 output 文件结尾。
使用参数 n 作为输出行的宽度。行缺省长度为 130 个字符。
以下列出了 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 的行为方式。
确定 sdiff 如何处理字符。将 LC_CTYPE 设为有效值时,sdiff 能够显示和处理包含对此语言环境有效的字符的文本和文件名。
有关下列属性的说明,请参见 attributes(7):
|