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

¡ÎÌ¾Á°¡Ï
ed - ÆüËÜ¸ì¥Æ¥­¥¹¥È¥¨¥Ç¥£¥¿

¡Î·Á¼°¡Ï
ed [ - ] [ name ]

¡Îµ¡Ç½ÀâÌÀ¡Ï
ed ¤ÏÉ¸½àÅª¤Ê¥Æ¥­¥¹¥È¥¨¥Ç¥£¥¿¤Ç¤¹¡£

°ú¿ô name ¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ ed ¤Ï¤½¤Î»ØÄê¤Î¥Õ¥¡¥¤¥ë¾å¤Ç¡¢¥³¥Þ¥ó¥Ée ¡Ê¸å½Ò¡Ë¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤¹¤Ê¤ï¤Á¡¢¥Õ¥¡¥¤¥ë¤Ï ed ¤Î¥Ð¥Ã¥Õ¥¡¤ËÆÉ¤ß¹þ¤Þ¤ì¡¢ÊÔ½¸²ÄÇ½¤Ë¤Ê¤ê¤Þ¤¹¡£¥ª¥×¥·¥ç¥ó¤Î - ¤Ï¡¢ÀâÌÀ½ÐÎÏ¤ÎÉ½¼¨¤ò¶Ø»ß¤·¡¢É¸½àÆþÎÏ¤¬¥¨¥Ç¥£¥¿¥¹¥¯¥ê¥×¥È¤Ç¤¢¤ë¾ì¹ç¤ËÍÑ¤¤¤Þ¤¹¡£

ed ¤ÏÊÔ½¸¤·¤¿¤¤Ç¤°Õ¤Î¥Õ¥¡¥¤¥ë¤Î¥³¥Ô¡¼¾å¤ÇÁàºî¤µ¤ì¤Þ¤¹¡£¥³¥Ô¡¼¾å¤ÎÊÑ²½¤Ïw ¥³¥Þ¥ó¥É¡Ê½ñ¤­¹þ¤ß¡Ë¤¬Í¿¤¨¤é¤ì¤ë¤Þ¤Ç¸µ¤Î¥Õ¥¡¥¤¥ë¤ò²¿¤âÊÑ²½¤µ¤»¤Þ¤»¤ó¡£ÊÔ½¸Ãæ¤Î¥Æ¥­¥¹¥È¤Î¥³¥Ô¡¼¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤È¸Æ¤Ð¤ì¤ë°ì»þÅª¥Õ¥¡¥¤¥ë¤ËÆÉ¤ß¹þ¤Þ¤ì¤Þ¤¹¡£

ed ¥³¥Þ¥ó¥É¤ÏÃ±½ã¤Çµ¬Â§Åª¤Ê¹½Â¤¤ò¤·¤Æ¤¤¤Þ¤¹¡£¥³¥Þ¥ó¥É¤Ï¡¢0 ¸Ä°Ê¾å¤Î¥¢¥É¥ì¥¹»ØÄê¤Ë 1 Ê¸»ú¥³¥Þ¥ó¥É¤¬Â³¤­¡¢¼¡¤ËÉ¬Í×¤Ç¤¢¤ì¤ÐÂ¾¤Î¥Ñ¥é¥á¡¼¥¿¤¬Â³¤­¤Þ¤¹¡£¤³¤ì¤é¤Î¥¢¥É¥ì¥¹¤Ï¥Ð¥Ã¥Õ¥¡Ãæ¤Î°ì¹Ô°Ê¾å¤Î¹Ô¤ò»ØÄê¤·¤Þ¤¹¡£¥¢¥É¥ì¥¹¤Î»ØÄê¤¬¤Ê¤±¤ì¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥¢¥É¥ì¥¹¤¬ÆÀ¤é¤ì¤Þ¤¹¡£

°ìÈÌ¤Ë¡¢1 ¹Ô¤Ë 1 ¸Ä¤Î¥³¥Þ¥ó¥É¤À¤±¤ò»ØÄê¤·¤Þ¤¹¡£¥³¥Þ¥ó¥É¤ÎÃæ¤Ë¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Æ¥­¥¹¥ÈÄÉ²Ã¤òµö²Ä¤¹¤ë¤â¤Î¤â¤¢¤ê¤Þ¤¹¡£ ed ¤¬¥Æ¥­¥¹¥È¤ò¼õ¤±Æþ¤ì¤Æ¤¤¤ë»þ¤òÆþÎÏ¥â¡¼¥É¤È¤¤¤¤¤Þ¤¹¡£¤³¤Î¥â¡¼¥É»þ¤Ï¤É¤Î¥³¥Þ¥ó¥É¤âÇ§¼±¤µ¤ì¤Þ¤»¤ó¡£¤¹¤Ù¤Æ¤ÎÆþÎÏ¤ÏÃ±¤Ë½¸ÀÑ¤µ¤ì¤ë¤À¤±¤Ç¤¹¡£ÆþÎÏ¥â¡¼¥É¤Ï¡¢¹ÔÆ¬¤Ë¤ª¤±¤ë¥Ô¥ê¥ª¥É. ¤Î¤ß¤Ë¤è¤Ã¤Æ²ò½ü¤µ¤ì¤Þ¤¹¡£

ed ¤Ï¡¢Àµµ¬É½¸½µ­Ë¡¤Î¸ÂÄê¤µ¤ì¤¿·Á¼°¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£1 ¸Ä¤ÎÀµµ¬É½¸½¤Ï°ìÁÈ¤ÎÊ¸»úÎó¤ò»ØÄê¤·¤Þ¤¹¡£¤³¤ÎÊ¸»úÎó½¸¹ç¤ÎÍ×ÁÇ¤Ï¡¢Àµµ¬É½¸½¤Ë¤è¤Ã¤Æ°ìÃ×¤·¤¿¤È¤¤¤¤¤Þ¤¹¡£°Ê²¼¤Ë¼¨¤·¤¿Àµµ¬É½¸½¤Î»ÅÍÍ¤Ë¤ª¤¤¤Æ¡¢¡ÉÊ¸»ú¡É¤È¤Ï²þ¹Ô°Ê³°¤Î¤¹¤Ù¤Æ¤ÎÊ¸»ú¤ò°ÕÌ£¤·¤Þ¤¹¡£

1.  ÆÃ¼ìÊ¸»ú°Ê³°¤Î 1 Ê¸»ú¤Ï¡¢¤½¤ì¼«¿È¤È°ìÃ×¤·¤Þ¤¹¡£ÆÃ¼ìÊ¸»ú¤Ï¡¢Àµµ¬É½¸½¤Î¶èÀÚ¤êÊ¸»ú¤ª¤è¤Ó \[.^*$ ¤Ç¤¹¡£

2.  ¥Ô¥ê¥ª¥É . ¤Ï¡¢Ç¤°Õ¤Î 1 Ê¸»ú¤È°ìÃ×¤·¤Þ¤¹¡£

3.  \ ¤Î¸å¤ËÇ¤°Õ¤Î 1 Ê¸»ú¤¬Â³¤¯Àµµ¬É½¸½¤Ï¡¢¤½¤ÎÊ¸»ú¤¬¿ô»ú¤Þ¤¿¤Ï () ¤Î¾ì¹ç¤ò½ü¤­¡¢¤½¤ÎÊ¸»ú¤È°ìÃ×¤·¤Þ¤¹¡£

4.  ¶õ¤Ç¤Ê¤¤Ê¸»úÎó s ¤ò¤«¤®¤«¤Ã¤³¤Ç¤¯¤¯¤Ã¤¿ [s] ¡Ê¤Þ¤¿¤Ï [^s] ¡Ë¤Ï¡¢Ê¸»úÎó s Ãæ¤Î¤¤¤º¤ì¤«¤Î 1 Ê¸»ú¡Ê¤Þ¤¿¤Ï¤¤¤º¤ì¤Ç¤â¤Ê¤¤ 1 Ê¸»ú¡Ë¤È°ìÃ×¤·¤Þ¤¹¡£Ê¸»úÎó s Ãæ¤Î \ ¤ÏÆÃÊÌ¤Î°ÕÌ£¤ò¤â¤Á¤Þ¤»¤ó¡£Ê¸»úÎó s Ãæ¤Î ] ¤Ï¡¢s¤ÎºÇ½é¤ÎÊ¸»ú¤Ë»ØÄê¤·¤¿¤È¤­¤À¤±¡¢ÆÃÊÌ¤Î°ÕÌ£¤ò¼º¤¤¡¢] ¼«¿È¤È°ìÃ×¤·¤Þ¤¹¡£Ê¸»úÎó s Ãæ¤ÎÊ¸»úÎó a-b ¤Ï¡¢a ¤È b ¤¬ EUC ¤Î¥³¡¼¥É½ç¤È¤Ê¤ê¡¢a ¤È b ¤¬Æ±°ì¤Î¥³¡¼¥É¥»¥Ã¥È¤Î¾ì¹ç¤Ë¡¢¤½¤ÎÈÏ°ÏÆâ¤Î EUC ¤ÎÊ¸»ú¤ò°ÕÌ£¤·¤Þ¤¹¡£

5.  * ¤¬¸å¤ËÂ³¤¯ 1 ¡Á 4 ¤Î·Á¼°¤ÎÀµµ¬É½¸½¤Ï¡¢0 ¸Ä¤Þ¤¿¤Ï 1 ¸Ä°Ê¾å¤ÎÀµµ¬É½¸½¤ò·«¤êÊÖ¤·¤¿Îó¤Ë°ìÃ×¤·¤Þ¤¹¡£

6.  1 ¡Á 8 ¤Î·Á¼°¤ÎÀµµ¬É½¸½ x ¤ò \( ¤È \) ¤Ç¤¯¤¯¤Ã¤¿ \(x\) ¤Ï¡¢x ¤È°ìÃ×¤·¤Þ¤¹¡£

7.  \ ¤Î¸å¤Ë¿ô»ú n ¤¬Â³¤¯Àµµ¬É½¸½¤Ï¡¢n ÈÖÌÜ¤Î \( ¤Ç»Ï¤Þ¤ëÀµµ¬É½¸½¤ÎÊ¸»úÎó¤Î¥³¥Ô¡¼¤È°ìÃ×¤·¤Þ¤¹¡£

8.  1 ¡Á 8 ¤Î·Á¼°¤ÎÀµµ¬É½¸½ x ¤È¡¢1 ¡Á 7 ¤Î·Á¼°¤ÎÀµµ¬É½¸½ y ¤ÎÏ¢·ë¤Ï¡¢x ¤Î°ìÃ×¤È y ¤Î°ìÃ×¤ÎÏ¢·ë¤È°ìÃ×¤·¤Þ¤¹¡£¤³¤Î°ìÃ×¤Ï¡¢y ¤Î°ìÃ×¤¬µö¤µ¤ì¤ë¸Â¤ê¡¢¤Ç¤­¤ë¤À¤± x ¤Î°ìÃ×¤¬Ä¹¤¯Â³¤¯¤è¤¦¤Ë¹Ô¤ï¤ì¤Þ¤¹¡£

9.  Æ¬¤Ë ^ ¤Î¤Ä¤¯¡Ê¤Þ¤¿¤Ï¸å¤í¤Ë $ ¤Î¤Ä¤¯¡Ë1 ¡Á 8 ¤Î·Á¼°¤ÎÀµµ¬É½¸½¤Ï¡¢¹Ô¤Îº¸Ã¼¡Ê¤Þ¤¿¤Ï±¦Ã¼¡Ë¤Ë¶¯À©Åª¤Ë°ìÃ×¤·¤Þ¤¹¡£

10. 1 ¡Á 9 ¤Î·Á¼°¤ÎÀµµ¬É½¸½¤Ï¡¢¹Ô¤ÎÃæ¤Çº¸µÍ¤á¤Ç»²¾È¤·¤¿Ãæ¤Î°ìÈÖÄ¹¤¤¤â¤Î¤Ë°ìÃ×¤·¤Þ¤¹¡£

11. ¶õ¤ÎÀµµ¬É½¸½¤Ï¡¢ºÇ¸å¤Ë»ØÄê¤µ¤ì¤¿Àµµ¬É½¸½¤È°ìÃ×¤·¤Þ¤¹¡£

Àµµ¬É½¸½¤Ï¥¢¥É¥ì¥¹¤Ç¹Ô¤ò»ØÄê¤·¤¿¤ê¡¢1 ¸Ä¤Î¥³¥Þ¥ó¥É¤Ç¡Ê¸å½Ò¤Î s ¤Î²òÀâ»²¾È¡ËÃÖ´¹¤¹¤Ù¤­¹Ô¤Î°ÌÃÖ¤ò»ØÄê¤·¤¿¤ê¤¹¤ë¤Î¤Ë»È¤ï¤ì¤Þ¤¹¡£Àµµ¬É½¸½¤Î¥á¥¿¥­¥ã¥é¥¯¥¿¤òÄÌ¾ïÊ¸»ú¤È¤·¤Æ»È¤¤¤¿¤¤»þ¤Ï¡¢¤½¤ÎÊ¸»ú¤ÎÁ°¤Ë \ ¤òÃÖ¤¯¤³¤È¤Ç²ÄÇ½¤È¤Ê¤ê¤Þ¤¹¡£¤³¤ì¤Ï¤Þ¤¿¡¢Àµµ¬É½¸½¤ò¶èÀÚ¤ëÊ¸»ú¡ÊÄÌ¾ï / ¡Ë¤È \ ¤½¤Î¤â¤Î¤Ë¤â¤¢¤Æ¤Ï¤Þ¤ê¤Þ¤¹¡£

ed ¤Ë¤ª¤±¤ë¥¢¥É¥ì¥¹¹Ô¤òÍý²ò¤¹¤ë¤Ë¤Ï¡¢¾ï¤Ë¸½ºß¹Ô¡Êcurrent line¡Ë¤¬Â¸ºß¤·¤Æ¤¤¤ë¤³¤È¤òÃÎ¤Ã¤Æ¤¤¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£°ìÈÌÅª¤Ë¡¢¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤¿ºÇ¸å¤Î¹Ô¤¬¸½ºß¹Ô¤È¤Ê¤ê¤Þ¤¹¡£¤·¤«¤·¡¢¸½ºß¹Ô¤Ø¤ÎÀµ³Î¤Ê¸ú²Ì¤Ï¡¢¥³¥Þ¥ó¥É¤ÎÉ½¸½¤Î¤â¤È¤ÇµÄÏÀ¤µ¤ì¤Þ¤¹¡£¥¢¥É¥ì¥¹¤Ï°Ê²¼¤Î¤è¤¦¤Ë¹½À®¤µ¤ì¤Þ¤¹¡£

1.  Ê¸»ú . ¤Ï¸½ºß¹Ô¤ò¥¢¥É¥ì¥¹¤·¤Þ¤¹¡£

2.  Ê¸»ú $ ¤Ï¥Ð¥Ã¥Õ¥¡¤ÎºÇ½ª¹Ô¤ò¥¢¥É¥ì¥¹¤·¤Þ¤¹¡£

3.  ½½¿Ê¿ô n ¤Ï¥Ð¥Ã¥Õ¥¡¤Î n ¹ÔÌÜ¤ò¥¢¥É¥ì¥¹¤·¤Þ¤¹¡£

4.  'x ¤ÏÌ¾Á° x ¤¬¥Þ¡¼¥¯¤µ¤ì¤¿¹Ô¤ò¥¢¥É¥ì¥¹¤·¤Þ¤¹¡£x ¤Ï ASCII ¤Î¾®Ê¸»ú¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¹Ô¤Ï¸å½Ò¤Î k ¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤Æ¥Þ¡¼¥¯¤µ¤ì¤Þ¤¹¡£

5.  ¥¹¥é¥Ã¥·¥å / ¤Ç°Ï¤Þ¤ì¤¿Àµµ¬É½¸½¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤ò¸½ºß¹Ô¤«¤éÁ°Êý¸þ¤ËÃµº÷¤·¡¢Àµµ¬É½¸½¤È°ìÃ×¤·¤¿Ê¸»úÎó¤ò´Þ¤àºÇ½é¤Î¹Ô¤Ç»ß¤Þ¤ê¤Þ¤¹¡£¤â¤·É¬Í×¤Ê¤é¡¢Ãµº÷¤Ï¥Ð¥Ã¥Õ¥¡¤ÎÀèÆ¬¤«¤éÂ³¤±¤Æ¤ª¤³¤Ê¤¤¤Þ¤¹¡£

6.  µ¿ÌäÉä ? ¤Ç°Ï¤Þ¤ì¤¿Àµµ¬É½¸½¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤ò¸½ºß¹Ô¤«¤é¸åÊý¸þ¤ËÃµº÷¤·¡¢Àµµ¬É½¸½¤Ë°ìÃ×¤·¤¿Ê¸»úÎó¤ò´Þ¤àºÇ½é¤Î¹Ô¤Ç»ß¤Þ¤ê¤Þ¤¹¡£¤â¤·É¬Í×¤Ê¤é¡¢Ãµº÷¤Ï¥Ð¥Ã¥Õ¥¡¤Î½ª¤ê¤«¤éÂ³¤±¤Æ¤ª¤³¤Ê¤¤¤Þ¤¹¡£

7.  ¥¢¥É¥ì¥¹¤Î¸å¤Ë²Ã»»µ­¹æ + ¡Ê¤Þ¤¿¤Ï¸º»»µ­¹æ - ¡Ë¤¬¤­¤Æ¡¢¤½¤Î¸å¤Ë 10 ¿Ê¿ô¤¬¤­¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥¢¥É¥ì¥¹¤Ë 10 ¿Ê¿ô¤ò²Ã»»¤·¤¿¹Ô¤ò¼¨¤·¤Þ¤¹¡£¡Ê¤Þ¤¿¤Ï¥¢¥É¥ì¥¹¤«¤é 10 ¿Ê¿ô¤ò¸º»»¤·¤¿¹Ô¤ò¼¨¤·¤Þ¤¹¡£¡Ë+ µ­¹æ¤Ï¾ÊÎ¬²ÄÇ½¤Ç¤¹¡£

8.  + ¤Þ¤¿¤Ï - ¤Ç»Ï¤Þ¤ë¥¢¥É¥ì¥¹¤Ï¡¢¸½ºß¹Ô¤«¤é¤ÎÁêÂÐ¥¢¥É¥ì¥¹¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£Â¨¤Á¡¢ -5 ¤Ï .-5 ¤Î°ÕÌ£¤À¤ÈÍý²ò¤µ¤ì¤Þ¤¹¡£

9.  + ¤Þ¤¿¤Ï - ¤Ç½ª¤ë¾ì¹ç¡¢¥¢¥É¥ì¥¹¤Ë 1 ¤ò²Ã»»¤¹¤ë¤«¡¢¤¢¤ë¤¤¤Ï 1 ¤ò¸º»»¤·¤Þ¤¹¡£¤³¤Îµ¬Â§¤ÈÁ°¤Îµ¬Â§¤È¤Î·ëÏÀ¤È¤·¤Æ¡¢¹Ô»ØÄê - ¤Ï¸½ºß¹Ô¤ÎÁ°¤Î¹Ô¤È¤Ê¤ê¤Þ¤¹¡£¤µ¤é¤Ë¸å¤Ë¤Ä¤¤¤Æ¤¤¤ë + ¤È - µ­¹æ¤Ë¤ÏÎßÀÑ¸ú²Ì¤¬¤¢¤ê¤Þ¤¹¡£¤Ä¤Þ¤ê¡¢ -- ¤Ï¸½ºß¹Ô¤è¤ê 2 ¹ÔÁ°¤È¤¤¤¦°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£

10. ed ¤Î½é´ü¥Ð¡¼¥¸¥ç¥ó¤È¤Î¸ß´¹À­¤òÊÝ¤Ä¤¿¤á¡¢¥¢¥É¥ì¥¹¤ÎÊ¸»ú ^ ¤Ï - ¤ÈÅù²Á¤Ç¤¹¡£

ed ¤Î¥³¥Þ¥ó¥É¤Ï 0 ¸Ä¤« 1 ¸Ä¤« 2 ¸Ä¤Î¥¢¥É¥ì¥¹¤òÉ¬Í×¤È¤·¤Þ¤¹¡£¥¢¥É¥ì¥¹¤òÉ¬Í×¤È¤·¤Ê¤¤¥³¥Þ¥ó¥É¤Ë¥¢¥É¥ì¥¹¤ò»ØÄê¤¹¤ë¤È¥¨¥é¡¼¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£1 ¸Ä¤Þ¤¿¤Ï2 ¸Ä¤Î¥¢¥É¥ì¥¹¤òÉ¬Í×¤È¤¹¤ë¥³¥Þ¥ó¥É¤Ë¥¢¥É¥ì¥¹¤¬»ØÄê¤µ¤ì¤Ê¤±¤ì¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥¢¥É¥ì¥¹»ØÄê¤¬¤µ¤ì¤Þ¤¹¡£¥³¥Þ¥ó¥É¤¬É¬Í×°Ê¾å¤Î¥¢¥É¥ì¥¹¤ò»ØÄê¤µ¤ì¤ë¤È¡¢ºÇ¸å¤Î 1 ¸Ä¤Þ¤¿¤Ï 2 ¸Ä¡Ê²¿¤¬»ØÄê¤µ¤ì¤¿¤«¤Ë¤è¤ë¡Ë¤Î¥¢¥É¥ì¥¹¤¬Í­¸ú¤È¤Ê¤ê¤Þ¤¹¡£

¹Ô¤ò»ØÄê¤¹¤ë¥¢¥É¥ì¥¹¤ÏÄÌ¾ï¤ª¸ß¤¤¤Ë¥³¥ó¥Þ , ¤Ë¤è¤Ã¤Æ¶èÀÚ¤é¤ì¤Æ¤¤¤Þ¤¹¡£¥¢¥É¥ì¥¹¤Ï¥»¥ß¥³¥í¥ó ; ¤Ç¶èÀÚ¤é¤ì¤ë¤³¤È¤â¤¢¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢¸½ºß¹Ô . ¤Ï¥»¥ß¥³¥í¥ó¤ÎÁ°¤Î¥¢¥É¥ì¥¹¤ËÀßÄê¤µ¤ì¡¢¤½¤Î¤¢¤È¤Ç¼¡¤Î¹Ô¤¬²ò¼á¤µ¤ì¤Þ¤¹¡£Á°Êý¸þ¤È¸åÊý¸þ¤ÎÃµº÷¥³¥Þ¥ó¥É¡Ê / , ? ¡Ë¤ËÂÐ¤¹¤ëµ¯ÅÀ¤ò·è¤á¤ë¤Î¤Ë¤³¤Îµ¡¹½¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Ç¤°Õ¤Î 2 ÁÈ¤Î¥¢¥É¥ì¥¹¤Ë¤ª¤¤¤Æ¡¢2 ÈÖÌÜ¤Î¥¢¥É¥ì¥¹¤ËÂÐ±þ¤¹¤ë¹Ô¤Ï¡¢ºÇ½é¤Î¥¢¥É¥ì¥¹¤ËÂÐ±þ¤¹¤ë¹Ô¤Î¸å¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£

°Ê²¼¤Ë¼¨¤¹ ed ¥³¥Þ¥ó¥É¤Î¥ê¥¹¥È¤Ë¤ª¤¤¤Æ¡¢¤«¤Ã¤³Ãæ¤Ë¥Ç¥Õ¥©¥ë¥È¤Î¥¢¥É¥ì¥¹¤ò¼¨¤·¤Þ¤·¤¿¡£¤«¤Ã¤³¤Ï¥¢¥É¥ì¥¹¤Î°ìÉô¤Ç¤Ï¤Ê¤¯¡¢¼¨¤·¤¿¥¢¥É¥ì¥¹¤¬¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ç¤¢¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

Á°½Ò¤·¤¿¤è¤¦¤Ë¡¢1 ¤Ä¤Î¹ÔÃæ¤Ë 2 ¤Ä°Ê¾å¤Î¥³¥Þ¥ó¥É¤ò»ØÄê¤¹¤ë¤³¤È¤Ï¡¢°ìÈÌ¤Ë¶Ø¤¸¤é¤ì¤Æ¤¤¤Þ¤¹¡£¤·¤«¤·¡¢¤Û¤È¤ó¤É¤Î¥³¥Þ¥ó¥É¤Ë¤Ï¸å¤í¤Ë p ¤ä l ¤òÉÕ¤±¤é¤ì¤Þ¤¹¡£¤³¤ì¤é¤Î¾ì¹ç¡¢¸½ºß¹Ô¤Ï¡¢¸å½Ò¤¹¤ë¤è¤¦¤Ë¡¢¤½¤ì¤¾¤ìÉ½¼¨¤µ¤ì¤¿¤ê¥ê¥¹¥È¤µ¤ì¤¿¤ê¤·¤Þ¤¹¡£¥³¥Þ¥ó¥É¤Î¸å¤í¤Ë¤Ï n ¤¬ÉÕ¤¯¤³¤È¤â¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï¡¢¥³¥Þ¥ó¥É¤Î½ÐÎÏ¤¬¹ÔÈÖ¹æ»ØÄê¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£¤³¤ì¤é¤ÎÀÜÈø¼­¤Ï¡¢½çÉÔÆ±¤Ç·ë¹ç¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£

(.)a
¡ã¥Æ¥­¥¹¥È¡ä
.
¥Æ¥­¥¹¥È¤ÎÄÉ²Ã¡£ÆþÎÏ¥â¡¼¥É¤ÇÀßÄê¤·¤¿¥Æ¥­¥¹¥È¤òÆÉ¤ß¼è¤ê¡¢¥¢¥É¥ì¥¹»ØÄê¤µ¤ì¤¿¹Ô¤Î¼¡¤Î¹Ô¤ËÄÉ²Ã¤·¤Þ¤¹¡£. ¤ÏºÇ½ªÆþÎÏ¹Ô¤È¤Ê¤ë¤«¡¢¤Þ¤¿¤Ï¥Æ¥­¥¹¥È¤ÎÆþÎÏ¤¬¤µ¤ì¤Ê¤±¤ì¤Ð»ØÄê¤µ¤ì¤¿¹Ô¤Ë¤Ê¤ê¤Þ¤¹¡£¥¢¥É¥ì¥¹ 0 ¤Ï¤³¤Î¥³¥Þ¥ó¥É¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢¤³¤Î¾ì¹ç¥Æ¥­¥¹¥È¤Ï¥Ð¥Ã¥Õ¥¡¤ÎÀèÆ¬¤ËÃÖ¤«¤ì¤Þ¤¹¡£

(., .)c
¡ã¥Æ¥­¥¹¥È¡ä
.
¹Ô¤ÎÊÑ¹¹¡£»ØÄê¤µ¤ì¤¿¹Ô¤ò¥Ð¥Ã¥Õ¥¡¤«¤éºï½ü¤·¡¢¤½¤Î¹Ô¤ËÊÑ¤ï¤ëÆþÎÏ¥Æ¥­¥¹¥È¤òÆþÎÏ¤·¤Þ¤¹¡£. ¤ÏºÇ¸å¤ÎÆþÎÏ¹Ô¤«¡¢¤Þ¤¿¤Ï¥Æ¥­¥¹¥È¤¬ÆþÎÏ¤µ¤ì¤Æ¤Ê¤±¤ì¤Ðºï½ü¤·¤¿¹Ô¤ÎÁ°¤Î¹Ô¤Ë¤Ê¤ê¤Þ¤¹¡£

(., .)d
¹Ô¤Îºï½ü¡£¥¢¥É¥ì¥¹¤Î»ØÄê¤µ¤ì¤¿¹Ô¤ò¥Ð¥Ã¥Õ¥¡¤«¤éºï½ü¤·¤Þ¤¹¡£ºï½ü¤µ¤ì¤¿¹Ô¤¬¤â¤È¤â¤ÈºÇ¸å¤Ë¤¢¤Ã¤¿¤Ê¤é¡¢¿·¤·¤¯ºÇ¸å¤Ë¤Ê¤Ã¤¿¹Ô¤¬¸½ºß¹Ô¤Ë¤Ê¤ê¤Þ¤¹¡£

e filename
¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸¡£¥Ð¥Ã¥Õ¥¡¤ÎÆâÍÆÁ´Éô¤òºï½ü¤·¤Æ¤«¤é»ØÄê¤Î¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£. ¤ò¥Ð¥Ã¥Õ¥¡¤ÎºÇ½ª¹Ô¤È¤·¡¢¥Ð¥Ã¥Õ¥¡¤ËÆÉ¤ß¹þ¤à¥Ð¥¤¥È¿ô¤òÉ½¼¨¤·¤Þ¤¹¡£¸å¤ËÂ³¤¯ r ¤Þ¤¿¤Ï w ¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤Æ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¤È¤·¤Æ»È¤¨¤ë¤è¤¦¤Ë¡¢ filename ¤Ïµ­²±¤µ¤ì¤Þ¤¹¡£filename ¤¬Í¿¤¨¤é¤ì¤Ê¤±¤ì¤Ð¡¢µ­²±¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ëÌ¾¤¬»ÈÍÑ¤µ¤ì¤Þ¤¹¡£

E filename 
¤³¤Î¥³¥Þ¥ó¥É¤Ï¤Û¤Ü e ¤ÈÆ±¤¸¤Ç¤¹¤¬¡¢ w ¤¬Í¿¤¨¤é¤ì¤Ê¤¤¾ì¹ç¤Ë¡¢ºÇ¸å¤Î¥Ð¥Ã¥Õ¥¡¤òÊÑ¹¹¤¹¤ë»þ¡¢¥Õ¥¡¥¤¥ë¤ÎÊÑ¹¹¤òÊÝÂ¸¤·¤¿¤«¤É¤¦¤«¤Î·Ù¹ð¤òÉ½¼¨¤·¤Þ¤»¤ó¡£

f filename
µ­²±¤µ¤ì¤¿¥Õ¥¡¥¤¥ëÌ¾¤ÎÉ½¼¨¡£¸½ºßµ­²±¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ëÌ¾¤òÉ½¼¨¤·¤Þ¤¹¡£filename ¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ì¤Ð¡¢¸½ºßµ­²±¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ëÌ¾¤Ïfilename ¤ËÊÑ¹¹¤µ¤ì¤Þ¤¹¡£

(1,$)g/Àµµ¬É½¸½/¥³¥Þ¥ó¥É¥ê¥¹¥È
¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥É g ¤Ï¡¢Ê£¿ô¹Ô¤ËÂÐ¤·¤Æ¥³¥Þ¥ó¥É¥ê¥¹¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤Þ¤º¡¢Í¿¤¨¤é¤ì¤¿Àµµ¬É½¸½¤Ë°ìÃ×¤¹¤ë¤¹¤Ù¤Æ¤Î¹Ô¤ò¥Þ¡¼¥¯¤·¤Þ¤¹¡£¼¡¤Ë¡¢³Æ¹Ô¤ËÂÐ¤·¤Æ¹ÔÆ¬¤Ë . ¤òÀßÄê¤·¤ÆÍ¿¤¨¤é¤ì¤¿¥³¥Þ¥ó¥É¥ê¥¹¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£1 ¤Ä¤Î¥³¥Þ¥ó¥É¤¢¤ë¤¤¤ÏÊ£¿ô¤Î¥³¥Þ¥ó¥É¤ÎºÇ½é¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥É¤ÈÆ±¤¸¹Ô¤Ë»ØÄê¤·¤Þ¤¹¡£Ê£¿ô¹Ô¥ê¥¹¥È¤ÎºÇ½ª¹Ô¤ò½ü¤¯¤¹¤Ù¤Æ¤Î¹Ô¤Ï¡¢ \ ¤Ç½ªÎ»¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
¥³¥Þ¥ó¥É a , i , c ¤È¡¢¤½¤ì¤Ë·ë¹ç¤¹¤ëÆþÎÏ¤Ïµö¤µ¤ì¤Þ¤¹¡£ÆþÎÏ¥â¡¼¥É¤ò½ªÎ»¤¹¤ë . ¤Ï¡¢¤½¤ì¤¬¥³¥Þ¥ó¥É¥ê¥¹¥È¤ÎºÇ½ª¹Ô¤Ë¤¢¤ì¤Ð¾ÊÎ¬²ÄÇ½¤Ç¤¹¡£¥³¥Þ¥ó¥É g ¤È v ¤Ï¡¢¥³¥Þ¥ó¥É¥ê¥¹¥È¤Ë¤Ï»ØÄê¤Ç¤­¤Þ¤»¤ó¡£

(.)i
¡ã¥Æ¥­¥¹¥È¡ä
.
¥Æ¥­¥¹¥È¤ÎÁÞÆþ¡£»ØÄê¹Ô¤ÎÁ°¤Î¹Ô¤Ë¥Æ¥­¥¹¥È¹Ô¤òÁÞÆþ¤·¤Þ¤¹¡£¸½ºß¹Ô¤ÏºÇ¸å¤ÎÆþÎÏ¹Ô¤Ë¤Ê¤ê¤Þ¤¹¡£¥Æ¥­¥¹¥È¤ÎÆþÎÏ¤¬¤Ê¤±¤ì¤Ð¡¢ . ¤Ï»ØÄê¤µ¤ì¤¿¹ÔÁ°¤Î¹Ô¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤Î¥³¥Þ¥ó¥É¤Ï¥Æ¥­¥¹¥È¤ÎÇÛÃÖ¤Ë¤Ä¤¤¤Æ¤Î¤ß¥³¥Þ¥ó¥Éa ¤È°Û¤Ê¤ê¤Þ¤¹¡£

(., .+1)j
¹Ô¤ÎÏ¢·ë¡£»ØÄê¤µ¤ì¤¿Ê£¿ô¹Ô¤ò 1 ¹Ô¤ËÏ¢·ë¤·¤Þ¤¹¡£Ãæ´Ö¤Î²þ¹Ô¤¬Ã±¤Ë¤Ê¤¯¤Ê¤ë¤À¤±¤Ç¤¹¡£ . ¤ÏÏ¢·ë¤Ë¤è¤êºî¤é¤ì¤¿¹Ô¤È¤Ê¤ê¤Þ¤¹¡£

( . )kx
¹Ô¥Þ¡¼¥¯¤ÎÀßÄê¡£»ØÄê¤µ¤ì¤¿¹Ô¤ò x ¤È¤¤¤¦Ì¾Á°¤Ç¥Þ¡¼¥¯¤·¤Þ¤¹¡£x ¤ÏASCII ¤Î¾®Ê¸»ú¤ò¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£'x ¤Ç¤³¤Î¹Ô¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£

(., .)l
ÈóÉ½¼¨Ê¸»ú¤ÎÉ½¼¨¡£É½¼¨¤µ¤ì¤ë»ØÄê¹Ô¤ÎÃæ¤Ç¡¢Èó°õ»úÊ¸»ú¤ò 2 ·å¤Î 8 ¿Ê¿ô¤ÇÉ½¼¨¤·¤Þ¤¹¡£Ä¹¤¤¹Ô¤Ï 2 ¹Ô°Ê¾å¤ËÀÞ¤êÊÖ¤·¤ÆÉ½¼¨¤µ¤ì¤Þ¤¹¡£¥³¥Þ¥ó¥É  l ¤ÏÆþ½ÐÎÏÁàºî¤ò¤·¤Ê¤¤¥³¥Þ¥ó¥É¤Î¸å¤Ç¤¢¤ì¤Ð¡¢Æ±¤¸¹Ô¤ËÃÖ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

(., .)ma
¹Ô¤Î°ÜÆ°¡£¥¢¥É¥ì¥¹»ØÄê¤µ¤ì¤¿¹Ô¤ò a ¤Ç»ØÄê¤·¤¿¹Ô¤Î¸å¤Ë°ÜÆ°¤·¤Þ¤¹¡£°ÜÆ°¤·¤¿¹ÔÆâ¤ÎºÇ½ª¹Ô¤¬¡¢¸½ºß¹Ô¤È¤Ê¤ê¤Þ¤¹¡£

(., .)p
¹Ô¤ÎÉ½¼¨¡£»ØÄê¤µ¤ì¤¿¹Ô¤òÉ½¼¨¤·¤Þ¤¹¡£. ¤ÏÉ½¼¨¤µ¤ì¤ëºÇ½ª¹Ô¤Ë¤Ê¤ê¤Þ¤¹¡£¥³¥Þ¥ó¥É p ¤ÏÆþ½ÐÎÏ½èÍý¤ò¤·¤Ê¤¤Áàºî¤Î¸å¤Ç¤¢¤ì¤Ð¡¢Æ±¤¸¹Ô¤ËÃÖ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

(., .)P
¤³¤Î¥³¥Þ¥ó¥É¤Ï p ¤ÈÆ±¤¸¤Ç¤¹¡£

q
ed ¥¨¥Ç¥£¥¿¤ò½ªÎ»¤µ¤»¤ë¥³¥Þ¥ó¥É¤Ç¤¹¡£¤¿¤À¤·¡¢¥Õ¥¡¥¤¥ë¤Ï¼«Æ°Åª¤Ë½ñ¤­¹þ¤Þ¤ì¤Þ¤»¤ó¡£

Q
¤³¤Î¥³¥Þ¥ó¥É¤Ï q ¤ÈÆ±¤¸¤Ç¤¹¡£¤¿¤À¤·¡¢°ÊÁ°¤Ë¥Ð¥Ã¥Õ¥¡¤ÎÆâÍÆ¤òÊÑ¹¹¤·¤¿¤È¤­¤Ë w ¤¬Í¿¤¨¤é¤ì¤Ê¤«¤Ã¤¿¤«¤É¤¦¤«¤ò¡¢·Ù¹ð¤·¤Þ¤»¤ó¡£

($)r filename
¥Õ¥¡¥¤¥ë¤«¤é¤ÎÆÉ¤ß¼è¤ê¡£¥¢¥É¥ì¥¹»ØÄê¤µ¤ì¤¿¹Ô¤Î¸å¤Ë¥Õ¥¡¥¤¥ëÌ¾¤ÎÆâÍÆ¤òÆÉ¤ß¼è¤Ã¤ÆÆþ¤ì¤Þ¤¹¡£¥Õ¥¡¥¤¥ëÌ¾¤¬Í¿¤¨¤é¤ì¤Ê¤±¤ì¤Ð¡¢µ­²±¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ëÌ¾¤¬¤¢¤ì¤Ð¤½¤ì¤¬»È¤ï¤ì¤Þ¤¹¡Ê¥³¥Þ¥ó¥É e ¤È f ¤ò»²¾È¡Ë¡£¥Õ¥¡¥¤¥ëÌ¾¤¬¤Þ¤Àµ­²±¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ÆÉ¤ß¼è¤é¤ì¤¿¥Õ¥¡¥¤¥ëÌ¾¤¬µ­²±¤µ¤ì¤Þ¤¹¡£¥¢¥É¥ì¥¹ 0 ¤Ï r ¤ËÍ­¸ú¤Ç¡¢¥Ð¥Ã¥Õ¥¡¤ÎÀèÆ¬¤Ë¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¼è¤ê¤Þ¤¹¡£ÆÉ¤ß¼è¤ê¤¬¤¦¤Þ¤¯¹Ô¤±¤Ð¡¢ÆÉ¤ß¼è¤Ã¤¿Ê¸»ú¿ô¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£¸½ºß¹Ô . ¤Ï¡¢¥Õ¥¡¥¤¥ë¤«¤éÆÉ¤ß¹þ¤Þ¤ì¤¿ºÇ¸å¤Î¹Ô¤È¤Ê¤ê¤Þ¤¹¡£

( ., .)s/Àµµ¬É½¸½/ÃÖ´¹Ê¸»úÎó/        ¤Þ¤¿¤Ï¡¢
( ., .)s/Àµµ¬É½¸½/ÃÖ´¹Ê¸»úÎó/g
ÃÖ´¹¥³¥Þ¥ó¥É¡£Àµµ¬É½¸½¤Ë°ìÃ×¤¹¤ëÊ¸»úÎó¤ò»ØÄê¤µ¤ì¤¿³Æ¹Ô¤«¤é¸«¤Ä¤±¡¢ÃÖ´¹Ê¸»úÎó¤ËÃÖ¤­´¹¤¨¤Þ¤¹¡£°ìÃ×¤¬¸«¤Ä¤«¤Ã¤¿³Æ¹Ô¤Ë¤ª¤¤¤Æ¡¢¥³¥Þ¥ó¥É¤Î¸å¤Ë¥°¥í¡¼¥Ð¥ëÃÖ´¹¤ò¼¨¤¹ g ¤ò»ØÄê¤¹¤ë¤È¡¢°ìÃ×¤¹¤ë¤¹¤Ù¤Æ¤ÎÊ¸»úÎó¤¬»ØÄê¤µ¤ì¤¿Ê¸»úÎó¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£g ¤Î»ØÄê¤¬Ìµ¤¤¾ì¹ç¡¢°ìÃ×¤¹¤ëºÇ½é¤ÎÊ¸»úÎó¤À¤±¤¬ÃÖ´¹¤µ¤ì¤Þ¤¹¡£»ØÄê¤µ¤ì¤¿¥¢¥É¥ì¥¹¹ÔÃæ¤ËÃÖ´¹¤¹¤ë¤â¤Î¤¬Á´¤¯Ìµ¤¤¤È¤­¤Ï¡¢¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£Àµµ¬É½¸½¤ÈÃÖ´¹Ê¸»úÎó¤È¤ò¶èÀÚ¤ë/ ¤ÎÂå¤ê¤Ë¡¢¶õÇòÊ¸»ú¤È²þ¹ÔÊ¸»ú°Ê³°¤ÎÇ¤°Õ¤ÎÊ¸»ú¤¬»ÈÍÑ¤Ç¤­¤Þ¤¹¡£. ¤Ï¡¢ÃÖ´¹¤¬¤ª¤³¤Ê¤ï¤ì¤¿ºÇ½ª¹Ô¤È¤Ê¤ê¤Þ¤¹¡£

ÃÖ´¹Ê¸»úÎó¤Ë¥¢¥ó¥Ñ¥µ¥ó¥É & ¤ò»ØÄê¤¹¤ë¤È¡¢Àµµ¬É½¸½¤Ë°ìÃ×¤¹¤ëÊ¸»úÎó¤ÈÃÖ´¹¤µ¤ì¤Þ¤¹¡£¤³¤Î´Ø·¸¤Ë¤ª¤±¤ë & ¤ÎÆÃ¼ìÊ¸»ú¤Î°ÕÌ£¤Ï¡¢ \ ¤òÀè¹Ô¤µ¤»¤ë¤³¤È¤ÇÍÞÀ©¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ n ¤¬¿ô»ú¤Ç¤¢¤ëÊ¸»úÎó \n ¤Ï¡¢\( ¤È \) ¤È¤Ë¤Ï¤µ¤Þ¤ì¤ë n ÈÖÌÜ¤ÎÀµµ¬É½¸½¤ËÂÐ±þ¤¹¤ë¥Æ¥­¥¹¥È¤ËÃÖ´¹¤µ¤ì¤Þ¤¹¡£Æþ¤ì»Ò¤Ë¤Ê¤Ã¤Æ¤«¤Ã¤³¤ËÆþ¤ì¤é¤ì¤¿ÉôÊ¬É½¸½¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢º¸¤«¤é»Ï¤Þ¤ë \( ¤Î½Ð¸½¤¹¤ë²ó¿ô¤ò¿ô¤¨¤ë¤³¤È¤Ç n ¤ò·è¤á¤Þ¤¹¡£

²þ¹Ô¤ò¤³¤ÎÊýË¡¤ÇÃÖ´¹¤¹¤ë¤³¤È¤Ç¡¢¹Ô¤òÊ¬³ä¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ÃÖ´¹Ê¸»úÎó¤ÎÃæ¤Î²þ¹Ô¤Ï¡¢\ ¤ÇÀè¹Ô¤·¤Æ¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
 
ÀÜÈø¼­ p ¤ò´Þ¤à¤È¤­¡¢¸åÂ³¤Î 1 ¤Ä¤« 2 ¤Ä¤Î¶èÀÚ¤ê¤Ï¾ÊÎ¬¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¶èÀÚ¤êÊ¸»ú¤¬Â³¤«¤Ê¤¤ÆÃ¼ì·Á¼° s ¤Ï¡¢¥¢¥É¥ì¥¹»ØÄê¤µ¤ì¤¿¹Ô¤ÎºÇÁ°¤ÎÂåÆþ¥³¥Þ¥ó¥É¤ò·«¤êÊÖ¤·¤Þ¤¹¡£s ¤Î¸å¤Ë¤Ïr¡Êº¸Â¦¤Ë¤¢¤ëÂåÆþ¥³¥Þ¥ó¥É¤Î¤¦¤Á°ìÈÖ¶á¤¤¤â¤Î¤Î¤«¤ï¤ê¤Ë¡¢º¸Â¦¤Ë¤¢¤ëÀµµ¬É½¸½¤Î¤¦¤ÁºÇÁ°¤Î¤â¤Î¤ò»ÈÍÑ¤·¤Þ¤¹¡Ë¡¢p¡ÊÁ°¤ÎÂåÆþ¤«¤éÀÜÈø¼­ p ¤ÎÀßÄê¤òÊäÂ­¤·¤Þ¤¹¡Ë¤Þ¤¿¤Ï g¡ÊÀÜÈø¼­ g ¤ÎÀßÄê¤òÊäÂ­¤·¤Þ¤¹¡Ë¤ÎÊ¸»ú¤òÂ³¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤ì¤é¤ÎÊ¸»ú¤Ï½çÉÔÆ±¤Ç·ë¹ç²ÄÇ½¤Ç¤¹¡£

(., .)ta
¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥³¥Þ¥ó¥É m ¤ÈÆ±¤¸Æ¯¤­¤ò¤·¤Þ¤¹¤¬¡¢¥¢¥É¥ì¥¹»ØÄê¤µ¤ì¤¿¥³¥Ô¡¼¤Ï¥¢¥É¥ì¥¹ a ¡Ê0¤Ç¤âÎÉ¤¤¡Ë¤Î¸å¤ËÃÖ¤«¤ì¤Þ¤¹¡£. ¤Ï¡¢¥³¥Ô¡¼¤ÎºÇ¸å¤Î¹Ô¤Ë¤Ê¤ê¤Þ¤¹¡£

(., .)u
¼è¤ê¾Ã¤·¡£¥³¥Þ¥ó¥É u ¤Ï¡¢Ä¾Á°¤Î¥Ð¥Ã¥Õ¥¡¤ÎÆâÍÆÊÑ¹¹Á°¤Ë¤½¤ÎÁàºî¤òÌµ¸ú¤Ë¤·¤Þ¤¹¡£¸½ºß¹Ô¤âÉüµ¢¤·¤Þ¤¹¡£¥Ð¥Ã¥Õ¥¡¤ÎÆâÍÆ¤òÊÑ¹¹¤¹¤ë¥³¥Þ¥ó¥É¤Ë¤Ï a, c, d, g, i, k ¤½¤·¤Æ v ¤¬¤¢¤ê¤Þ¤¹¡£¼è¤ê¾Ã¤·¤ÎÌÜÅª¤Î¤¿¤á¤Ë,g ¤È v ¤ÏÃ±°ì¤Î¥Ð¥Ã¥Õ¥¡ÆâÍÆÊÑ¹¹¥³¥Þ¥ó¥É¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£ u ¼«¿®¤â¼è¤ê¾Ã¤»¤Þ¤¹¡£
ed ¤Î¥á¥â¥ê¤¬ÉÔÂ­¤·¤Æ¼è¤ê¾Ã¤·¤¬¼Â¹Ô¤Ç¤­¤Ê¤¤»þ¡¢ u ¤Ï¸½ºß¹Ô¤ÎºÇÁ°¤ÎÂåÆþÁàºî¤Î¸ú²Ì¤Î¤ß¤ò¼è¤ê¾Ã¤·¤Þ¤¹¡£¤³¤ÎÀ©¸Â¤µ¤ì¤¿¼è¤ê¾Ã¤·¤Ï¡¢ ed¤¬ - ¥ª¥×¥·¥ç¥ó¤È¤È¤â¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿»þ¡¢¥¨¥Ç¥£¥¿¥¹¥¯¥ê¥×¥È¤Ë¤âÅ¬ÍÑ¤µ¤ì¤Þ¤¹¡£

(1, $)v/Àµµ¬É½¸½/¥³¥Þ¥ó¥É¥ê¥¹¥È
¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥É g ¤È¤ÏµÕ¤Ë¡¢Àµµ¬É½¸½¤ò´Þ¤à¹Ô¤ò½ü¤¯¤¹¤Ù¤Æ¤Î¹Ô¤Ë¥³¥Þ¥ó¥É¥ê¥¹¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£

(1, $)w filename
¹Ô¤Î½ñ¤­¹þ¤ß¡£¥¢¥É¥ì¥¹»ØÄê¤µ¤ì¤¿¹Ô¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡£¥Õ¥¡¥¤¥ëÌ¾¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢¿·¤·¤¯ºîÀ®¤·¤Þ¤¹¡£µ­²±¤µ¤ì¤¿¥Õ¥¡¥¤¥ëÌ¾¤¬Ìµ¤¤¾ì¹ç¡¢¤³¤Î¥Õ¥¡¥¤¥ëÌ¾¤¬µ­²±¤µ¤ì¤Þ¤¹¡£¥Õ¥¡¥¤¥ëÌ¾¤Î»ØÄê¤¬¤Ê¤¤¾ì¹ç¡¢µ­²±¤µ¤ì¤¿¥Õ¥¡¥¤¥ëÌ¾¤¬¤â¤·¤¢¤ì¤Ð¤½¤ì¤¬»ÈÍÑ¤µ¤ì¤Þ¤¹¡Ê¥³¥Þ¥ó¥É e ¤È f »²¾È¡Ë¡£. ¤ÏÊÑ¹¹¤µ¤ì¤Þ¤»¤ó¡£½ñ¤­¹þ¤ß¤¬¤¦¤Þ¤¯¹Ô¤±¤Ð½ñ¤­¹þ¤Þ¤ì¤¿Ê¸»ú¿ô¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£

(1, $)W filename
¤³¤Î¥³¥Þ¥ó¥É¤Ï w ¤ÈÆ±¤¸¤Ç¤¹¤¬¡¢¥¢¥É¥ì¥¹»ØÄê¤µ¤ì¤¿¹Ô¤¬¥Õ¥¡¥¤¥ë¤ËÄÉ²Ã¤µ¤ì¤Þ¤¹¡£

($)=
¹ÔÈÖ¹æ¤ÎÉ½¼¨¡£¥¢¥É¥ì¥¹»ØÄê¤µ¤ì¤¿¹Ô¤Î¹ÔÈÖ¹æ¤òÉ½¼¨¤·¤Þ¤¹¡£¤³¤Î¥³¥Þ¥ó¥É¤Ç . ¤ÏÊÑ¹¹¤µ¤ì¤Þ¤»¤ó¡£

!¡ã¥·¥§¥ë¥³¥Þ¥ó¥É¡ä
¥·¥§¥ë¥³¥Þ¥ó¥É¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¤è¤¦¤Ë¡¢! ¤Î¸å¤Î¥³¥Þ¥ó¥É¤¬ sh(1) ¤Ë¤ï¤¿¤µ¤ì¤Þ¤¹¡£. ¤ÏÊÑ¹¹¤µ¤ì¤Þ¤»¤ó¡£

(.+1,.+1)¡ã²þ¹Ô¡ä
¥¢¥É¥ì¥¹¤Î¤ß¤òÆþÎÏ¤·²þ¹Ô¤¹¤ë¤È¡¢¥¢¥É¥ì¥¹»ØÄê¤µ¤ì¤¿¹Ô¤òÉ½¼¨¤·¤Þ¤¹¡£²¿¤âÆþÎÏ¤»¤º¤Ë²þ¹Ô¤¹¤ë¤Î¤Ï¡¢.+1p ¤ÈÆ±¤¸¤Ç¤¹¡£¤³¤ì¤Ï¥Æ¥­¥¹¥È¤ò¹ÔÁ÷¤ê¤¹¤ë¤Î¤ËÍ­¸ú¤Ç¤¹¡£2 ¤Ä¤Î¥¢¥É¥ì¥¹´Ö¤Ë¥»¥ß¥³¥í¥ó¤¬¤Ê¤±¤ì¤Ð¡¢ed ¤Ï¹Ô¤ÎÎÎ°è¤òÉ½¼¨¤·¤Þ¤¹¡£¥»¥ß¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ì¤Ð¡¢¸å¤Î¹Ô¤òÉ½¼¨¤·¤Þ¤¹¡£

³ä¤ê¹þ¤ß¿®¹æ¡ÊASCII DEL¡Ë¤¬Á÷¤é¤ì¤¿»þ¡¢ ed ¤Ï ? ¤òÉ½¼¨¤·¡¢¥³¥Þ¥ó¥É¥ì¥Ù¥ë¤ËÌá¤·¤Þ¤¹¡£

¥µ¥¤¥º¤ÎÀ©Ìó¤Ë¼¡¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£1 ¹Ô¤Ë¤Ä¤­ 512 Ê¸»ú¡¢¥°¥í¡¼¥Ð¥ë¥³¥Þ¥ó¥É 1 ¤Ä¤Ë¤Ä¤­ 236 ¥Ð¥¤¥È¡¢¥Õ¥¡¥¤¥ëÌ¾ 1 ¤Ä¤Ë¤Ä¤­ 64 ¥Ð¥¤¥È¡¢¥ß¥Ë¥³¥ó¥Ô¥å¡¼¥¿¤Ç¤Ï¡¢°ì»þ¥Õ¥¡¥¤¥ë 1 ¤Ä¤Ë¤Ä¤­ 128K ¥Ð¥¤¥È¤ÎÀ©¸Â¤¬¤¢¤ê¤Þ¤¹¡£¹Ô¿ô¤ÎÀ©¸Â¤Ï¡¢¥³¥¢¤ÎÍÆÎÌ¤Ë¤è¤Ã¤Æ·è¤Þ¤ê¤Þ¤¹¡£ ³Æ¹Ô¤Ï¡¢2 ¸ì¤Î¥á¥â¥ê¤ò»È¤¤¤Þ¤¹¡£

¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à»þ¡¢ ed ¤Ï ASCII ¥³¡¼¥É¤Î¥Ì¥ëÊ¸»ú¤È¡¢ºÇ¸å¤Î²þ¹Ô°Ê¸å¤Î¤¹¤Ù¤Æ¤ÎÊ¸»ú¤ò¼º¤¤¤Þ¤¹¡£ 

¡Î¥Õ¥¡¥¤¥ë¡Ï
/tmp/e*
edhup¡§Ã¼Ëö¤¬Ää»ß¤·¤¿¤È¤­¡¢¥ï¡¼¥¯¥Õ¥¡¥¤¥ë¤Ï¤³¤³¤Ë¥»¡¼¥Ö¤µ¤ì¤Þ¤¹¡£

¡Î´ØÏ¢¹àÌÜ¡Ï
B. W. Kernighan, A Tutorial Introduction to the ED Text Editor
B. W. Kernighan, Advanced editing on UNIX
ex(1), sed(1)
3.3J ¥ê¥ê¡¼¥¹¥Î¡¼¥È UNIX ¥³¥Þ¥ó¥É ¥é¥¤¥Ö¥é¥ê

¡Î¿ÇÃÇ¡Ï
?name ¤Ï¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¥Õ¥¡¥¤¥ë¤ËÂÐ¤·¤ÆÉ½¼¨¤µ¤ì¤Þ¤¹¡£
? ¤Ï¤½¤ÎÂ¾¤Î¥¨¥é¡¼¤ËÂÐ¤·¤ÆÉ½¼¨¤µ¤ì¤Þ¤¹¡£

µ®½Å¤Ê¥ï¡¼¥¯¥Õ¥¡¥¤¥ë¤ò¸í¤Ã¤Æ¼º¤¦¤³¤È¤òËÉ¤°¤¿¤á¡¢ºÇ¸å¤Î¥Ð¥Ã¥Õ¥¡¤ÎÊÑ¹¹¤Þ¤Çw ¤¬»È¤ï¤ì¤Ê¤±¤ì¤Ð¡¢q ¥³¥Þ¥ó¥É¤Þ¤¿¤Ï e ¥³¥Þ¥ó¥É¤Ï¥¨¥é¡¼¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£ÆóÅÙÌÜ¤Î q ¤ä e ¤Ï¼Â¹Ô¤µ¤ì¤Þ¤¹¡£

¡ÎÆüËÜ¸ìµ¡Ç½¡Ï
¥Õ¥¡¥¤¥ëÌ¾¤ª¤è¤Ó¥Õ¥¡¥¤¥ëÃæ¤Î¥Æ¥­¥¹¥È¤Ë¡¢EUCÊ¸»ú¤¬¡¢»ÈÍÑ¤Ç¤­¤Þ¤¹¡£

Àµµ¬É½¸½ [ ]
Àµµ¬É½¸½ [ ] ¤òÍÑ¤¤¤Æ¡¢ÈÏ°Ï»ØÄê¤ò¤ª¤³¤Ê¤¦¾ì¹ç¡¢°Û¤Ê¤ë¥³¡¼¥É¥»¥Ã¥È¤Ë¤Þ¤¿¤¬¤ëÈÏ°Ï¤ò»ØÄê¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
°Û¤Ê¤ë¥³¡¼¥É¥»¥Ã¥È¤Ë¤Þ¤¿¤¬¤ëÈÏ°Ï¤ò»ØÄê¤·¤¿¾ì¹ç¡¢ÈÏ°Ï¤ò»ØÄê¤¹¤ëºÇ½é¤ÈºÇ¸å¤ÎÊ¸»ú¤Ë¤Î¤ß°ìÃ×¤·¤Þ¤¹¡£
Îã¤¨¤Ð¡¢[a-°¡] ¤Ï¡¢[a°¡] ¤ÈÆ±°ì»ë¤µ¤ì¡¢`a' ¤Þ¤¿¤Ï `°¡' ¤È°ìÃ×¤·¤Þ¤¹¡£ [^a-°¡] ¤Ï¡¢[^a°¡] ¤ÈÆ±°ì»ë¤µ¤ì¡¢`a' , `°¡' °Ê³°¤Î¤¹¤Ù¤Æ¤ÎÊ¸»ú¤È°ìÃ×¤·¤Þ¤¹¡£
   
l ¥³¥Þ¥ó¥É¤Ë¤è¤ëÀÞ¤êÊÖ¤·½èÍý
72-73¥«¥é¥à¾å¤ËÁ´³ÑÊ¸»ú¤¬ÇÛÃÖ¤µ¤ì¤ë¾ì¹ç¡¢72¥«¥é¥à¾å¤Ë¤Ï¡¢\ ¤¬É½¼¨¤µ¤ì¡¢Á´³ÑÊ¸»ú¤Ï¡¢¼¡¤Î¹Ô¤ËÉ½¼¨¤µ¤ì¤Þ¤¹¡£

¡ÎÃí°Õ»ö¹à¡Ï    
¥³¥Þ¥ó¥Él¤Ï¡¢DEL ¤Î½èÍý¤ËÂÐ¤·¤Æ¸íÆ°ºî¤·¤Þ¤¹¡£
¼è¤ê¾Ã¤·¥³¥Þ¥ó¥É u ¤Ë¤è¤Ã¤Æ»ØÄê¹Ô¤Î¥Þ¡¼¥¯¤Ï¼º¤ï¤ì¤Þ¤¹¡£
Ã¼ËöÄä»ß¤ËÂÐ¤¹¤ëÆÃ¼ì½èÍý¤Ï¡¢UNIX ¾å¤Î¤ß¤ÇÆ¯¤­¤Þ¤¹¡£