DIFF3(1)		UNIX ¥³¥Þ¥ó¥É		DIFF3(1)

¡ÎÌ¾Á°¡Ï
diff3 - 3¤Ä¤Î¥Õ¥¡¥¤¥ë¤Îº¹Ê¬Èæ³Ó

¡Î·Á¼°¡Ï
diff3 [ -exEX3 ] file1 file2 file3

¡Îµ¡Ç½ÀâÌÀ¡Ï
diff3¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó¤Î°Û¤Ê¤ë3¤Ä¤Î¥Õ¥¡¥¤¥ë¤òÈæ³Ó¤·¤Æ¥Æ¥­¥¹¥È¤Î°ìÃ×¤·¤Ê¤¤ÈÏ°Ï¤ò¼¡¤Î¥³¡¼¥É¤ò»È¤Ã¤ÆÉ½¼¨¤·¤Þ¤¹¡£

====		3¤Ä¤Î¥Õ¥¡¥¤¥ë¤¬¤¹¤Ù¤Æ°Û¤Ê¤ë¡£

====1		file1¤¬°Û¤Ê¤ë¡£

====2		file2¤¬°Û¤Ê¤ë¡£

====3		file3¤¬°Û¤Ê¤ë¡£

É½¼¨¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÈÏ°Ï¤ò¡¢Â¾¤Î¥Õ¥¡¥¤¥ë¤ËÊÑ´¹¤¹¤ë¤Ë¤Ï¼¡¤ÎÊýË¡¤Ë¤è¤ê¤Þ¤¹¡£

f : n1 a	¥Æ¥­¥¹¥È¤ò¥Õ¥¡¥¤¥ëf¤Î¹ÔÈÖ¹æn1¤Î¸å¤í¤ËÄÉ²Ã¡£¤³¤³¤Ç¡¢f¤Ï1¡¢2¡¢3¤Î¤É¤ì¤«¤Ç¤¹¡£

f : n1 , n2 c	¥Æ¥­¥¹¥È¤Ï¡¢¹Ôn1¤«¤é¹Ôn2¤Þ¤Ç¤ÎÈÏ°Ï¤ËÊÑ¹¹¤µ¤ì¤ë¡£¤â¤·¡¢n1 = n2¤Ê¤é¤ÐÈÏ°Ï¤Ïn1¤Ë¾ÊÎ¬¤µ¤ì¤Þ¤¹¡£

ÈÏ°Ï¤Î¸µ¤ÎÆâÍÆ¤Ï¡¢cÉ½µ­¤ÎÄ¾¸å¤Ë¼¨¤µ¤ì¤Þ¤¹¡£2¤Ä¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤¬Æ±°ì¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ÈÖ¹æ¤Î¾®¤µ¤¤¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤¬¾ÊÎ¬¤µ¤ì¤Þ¤¹¡£

-e¥ª¥×¥·¥ç¥ó¤Ç¤Ï¡¢diff3¤Ïfile1¤Ëfile2¤Èfile3¤È¤ÎÁê°ã¡¢¤¹¤Ê¤ï¤Á====¤ª¤è¤Ó====3¤Ç¼¨¤µ¤ì¤ëÊÑ¹¹¤òÁÈ¤ß¹þ¤à¤è¤¦¤Ê¡¢¥¨¥Ç¥£¥¿ed¤Î¥¹¥¯¥ê¥×¥È¤ò½ÐÎÏ¤·¤Þ¤¹¡£

¥ª¥×¥·¥ç¥ó-x(-3)¤Ï¡¢====(====3)¤Ç¼¨¤µ¤ì¤ëÊÑ¹¹¤Î¤ß¤òÁÈ¤ß¹þ¤à¤è¤¦¤Ê¥¹¥¯¥ê¥×¥È¤òÀ¸À®¤·¤Þ¤¹¡£¼¡¤Î¥³¥Þ¥ó¥É¤Ï¡¢·ë²Ì¤Î¥¹¥¯¥ê¥×¥È¤òfile1¤ËÅ¬ÍÑ¤·¤Þ¤¹¡£

		(cat script; echo '1,$p') | ed - file1

-E¤È-X¤Ï¡¢-e¡¢-x¤Ë¤«¤Ê¤ê»÷¤Æ¤¤¤Þ¤¹¤¬½ÅÊ£¤¹¤ëÁê°ãÉôÊ¬(¤¹¤Ê¤ï¤Á¡¢ÄÌ¾ï¤Î¥ê¥¹¥È¤Î¤Ê¤«¤Ç====¤Ç¼¨¤µ¤ì¤ëÁê°ã)¤ò°Û¤Ê¤ë·Á¤Ç°·¤¤¤Þ¤¹¡£Î¾Êý¤Î¥Õ¥¡¥¤¥ë¤Ç½ÅÊ£¤¹¤ë¹Ô¤Ï¡¢edit¥¹¥¯¥ê¥×¥È¤Ë¤è¤ê<<<<µÚ¤Ó>>>>¤Ç°Ï¤Þ¤ì¤¿¾å¤ÇÁÞÆþ¤µ¤ì¤Þ¤¹¡£

Îã¤¨¤Ð¡¢7¹ÔÌÜ¡¢8¹ÔÌÜ¤¬file1¡¢file2¤ÎÎ¾Êý¤Ç°Û¤Ê¤Ã¤Æ¤¤¤ë¤È¤·¤Þ¤¹¡£

	diff3 -E file1 file2 fil3

¤³¤Î¥³¥Þ¥ó¥É¤Ë¤è¤êÀ¸À®¤µ¤ì¡¢file1¤ËÅ¬ÍÑ¤µ¤ì¤ëedit¥¹¥¯¥ê¥×¥È¤Ï°Ê²¼¤ÎÍÍ¤Ë¼¨¤µ¤ì¤Þ¤¹¡£

		lines 1-6
		of file1
		<<<<<< file1
		lines 7-8
		======
		lines 7-8
		of file3
		>>>>>> file3
		rest of file1

-E¥ª¥×¥·¥ç¥ó¤Ï RCS ¤Î merge(1) ¥³¥Þ¥ó¥É¤Ç»ÈÍÑ¤µ¤ì¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¥Þ¡¼¥¸¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î½ÅÊ£ÉôÊ¬¤¬ÊÝÂ¸¤µ¤ì¤¿¤³¤È¤òÊÝ¾Ú¤·¡¢Ãí°Õ¤òÂ¥¤·¤Þ¤¹¡£

¡ÎÆüËÜ¸ìµ¡Ç½¡Ï
Èæ³Ó¤¹¤ë¥Õ¥¡¥¤¥ëÌ¾¡¢¥Ç¥£¥ì¥¯¥È¥êÌ¾file¡¢dir ¤ËEUCÊ¸»ú¤ò´Þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
¤Þ¤¿¡¢fileÆâ¤ËEUCÊ¸»ú¤ò´Þ¤ó¤À¥Õ¥¡¥¤¥ë¤òÈæ³Ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

¡Î¥Õ¥¡¥¤¥ë¡Ï
/tmp/d3?????
/usr/lib/nje/diff3

¡Î´ØÏ¢¹àÌÜ¡Ï
diff(1)

¡ÎÃí°Õ»ö¹à¡Ï
`.'¤À¤±¤«¤éÀ®¤ë¥Æ¥­¥¹¥È¹Ô¤Ë¤Ï¡¢ -e ¥ª¥×¥·¥ç¥ó¤¬ºîÍÑ¤·¤Þ¤»¤ó¡£