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

¡ÎÌ¾Á°¡Ï
sh, for, case, if, while, :, ., %, break, continue, cd, eval, exec, exit, export, bg, fg, jobs, login, read, readonly, set, shift, times, trap, umask, wait - ¥³¥Þ¥ó¥É¸À¸ì

¡Î·Á¼°¡Ï
sh [ -ceiknrstuvxJ ] [ arg ] ...
jsh [ -ceiknrstuvxJ ] [ arg ] ...

¡Îµ¡Ç½ÀâÌÀ¡Ï
sh ¤Ï¡¢¥³¥Þ¥ó¥É¡¦¥×¥í¥°¥é¥ß¥ó¥°¡¦¸À¸ì¤Ç¤¹¡£Ã¼Ëö¤ä¥Õ¥¡¥¤¥ë¤«¤éÆÉ¤ß¼è¤Ã¤¿¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£jsh ¤Ï¡¢Æ±°ì¥Õ¥¡¥¤¥ë¤Ç¤¹¤¬¡¢csh¥¹¥¿¥¤¥ë¤Î¥¸¥ç¥ÖÀ©¸æµ¡Ç½¤ò»ÈÍÑ¤Ç¤­¤Þ¤¹¡£¡Ê¥¸¥ç¥ÖÀ©¸æµ¡Ç½¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ csh(1) ¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ë¥·¥§¥ë¤ËÂÐ¤¹¤ë°ú¿ô¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ï¡¢µ¯Æ°¡Êinvocation¡Ë¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

¡Î¥³¥Þ¥ó¥É¡Ï
Ã±½ã¥³¥Þ¥ó¥É¤È¤Ï¡¢¥Ö¥é¥ó¥¯¡Ê¥¿¥Ö¤Þ¤¿¤Ï¶õÇòÊ¸»ú¡Ë¤Ç¶èÀÚ¤é¤ì¤¿¥Ö¥é¥ó¥¯°Ê³°¤Î¥ï¡¼¥É¤ÎÎó¤Ç¤¹¡£ºÇ½é¤Î¥ï¡¼¥É¤Ë¤Ï¡¢¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¤ÎÌ¾Á°¡Êname¡Ë¤ò»ØÄê¤·¤Þ¤¹¡£»Ä¤ê¤Î¥ï¡¼¥É¤Ï¡¢¡Ê°Ê²¼¤Ë¼¨¤¹¾ì¹ç¤ò½ü¤­¡Ë¡¢µ¯Æ°¤µ¤ì¤ë¥³¥Þ¥ó¥É¤Ø°ú¿ô¤È¤·¤ÆÅÏ¤µ¤ì¤Þ¤¹¡£¥³¥Þ¥ó¥ÉÌ¾¤Ï¡¢0ÈÖÌÜ¤Î°ú¿ô¡Êargument 0¡Ë¤È¤·¤ÆÅÏ¤µ¤ì¤Þ¤¹¡Ê¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢execve(2)¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡Ë¡£Ã±½ã¥³¥Þ¥ó¥É¤ÎÊÖ¤¹ÃÍ¤Ï¡¢Àµ¾ï½ªÎ»¤Î¾ì¹ç¤Ë¤Ï¡¢¤½¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¡Êexit status¡Ë¡¢°Û¾ï½ªÎ»¤Î¾ì¹ç¤Ë¤Ï ¡¢200+status ¤Ç¤¹¡Êstatus ¤ÎÃÍ¤Ë¤Ä¤¤¤Æ¤Ï sigvec(2) ¤Î¥ê¥¹¥È¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡Ë¡£

¥Ñ¥¤¥×¥é¥¤¥ó¤È¤Ï¡¢1¸Ä°Ê¾å¤Î¥³¥Þ¥ó¥É¤ÎÎó¤¬ | ¤Ç¶èÀÚ¤é¤ì¤¿¤â¤Î¤Ç¤¹¡£³Æ¥³¥Þ¥ó¥É¤ÎÉ¸½à½ÐÎÏ¤Ï¡¢¡ÊºÇ¸å¤Î¥³¥Þ¥ó¥É¤ò½ü¤­¡Ë¡¢¼¡¤Î¥³¥Þ¥ó¥É¤ÎÉ¸½àÆþÎÏ¤Ë pipe(2) ¤Ë¤è¤êÀÜÂ³¤µ¤ì¤Þ¤¹¡£³Æ¥³¥Þ¥ó¥É¤Ï¡¢ÊÌ¡¹¤Î¥×¥í¥»¥¹¤È¤·¤Æ¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¤½¤ÎºÝ¡¢¥·¥§¥ë¤ÏºÇ¸å¤Î¥³¥Þ¥ó¥É¤¬½ªÎ»¤¹¤ë¤Þ¤ÇÂÔ¤Á¤Þ¤¹¡£

¥ê¥¹¥È¤È¤Ï¡¢1¸Ä°Ê¾å¤Î¥Ñ¥¤¥×¥é¥¤¥ó¤ÎÎó¤¬ ;, &, && ¤Þ¤¿¤Ï || ¤Ç¶èÀÚ¤é¤ì¤¿¤â¤Î¤Ç¤¹¡£¡Ê¥ª¥×¥·¥ç¥ó¤È¤·¤Æ¡¢ ; ¤Þ¤¿¤Ï &¤Ç½ªÎ»¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¡Ë ; ¤È & ¤ÏÆ±¤¸Í¥Àè½ç°Ì¤ò»ý¤Á¡¢¤½¤ÎÍ¥Àè½ç°Ì¤Ï && ¤ä || ¤è¤ê¤âÄã¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤Þ¤¿¡¢ && ¤È || ¤âÆ±¤¸Í¥Àè½ç°Ì¤ò»ý¤Á¤Þ¤¹¡£¥»¥ß¥³¥í¥ó¡Ê;¡Ë¤Ç¶èÀÚ¤é¤ì¤¿¥Ñ¥¤¥×¥é¥¤¥ó¤Ï¡¢Ãà¼¡Åª¡Êsequential¡Ë¤Ë¼Â¹Ô¤µ¤ì¤Þ¤¹¡£°ìÊý¡¢¥¢¥ó¥Ñ¥µ¥ó¥É¡Ê&¡Ë¤Ç¶èÀÚ¤é¤ì¤¿¥Ñ¥¤¥×¥é¥¤¥ó¤Ç¤Ï¡¢Àè¹Ô¤¹¤ë¥Ñ¥¤¥×¥é¥¤¥ó¤¬½ªÎ»¤¹¤ë¤Î¤òÂÔ¤¿¤º¤Ë¼¡¤Î¥Ñ¥¤¥×¥é¥¤¥ó¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£µ­¹æ && ¡Ê¤ª¤è¤Ó || ¡Ë¤¬¥ê¥¹¥È¤Î¸åÂ³¤¹¤ë¥Ñ¥¤¥×¥é¥¤¥ó¤ò¼Â¹Ô¤¹¤ë¤Î¤Ï¡¢Àè¹Ô¤¹¤ë¥Ñ¥¤¥×¥é¥¤¥ó¤¬¥¼¥í¡Ê¤ª¤è¤Ó¥¼¥í°Ê³°¡Ë¤ÎÃÍ¤òÊÖ¤·¤¿¾ì¹ç¤Î¤ß¤Ë¸Â¤ê¤Þ¤¹¡£²þ¹Ô¤ò¥ê¥¹¥ÈÆâ¤ËÆþ¤ì¤Æ¡¢¡Ê¥»¥ß¥³¥í¥ó¤ÎÂå¤ï¤ê¤Ë¡Ë¡¢¥³¥Þ¥ó¥É¤ò¶èÀÚ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£

¥³¥Þ¥ó¥É¤È¤Ï¡¢Ã±½ã¥³¥Þ¥ó¥É¤«¡¢¤¢¤ë¤¤¤Ï²¼µ­¤Î¤â¤Î¤Î¤¤¤º¤ì¤«¤Ç¤¹¡£ÆÃ¤Ë»ØÄê¤Î¤Ê¤¤¸Â¤ê¡¢¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ëÃÍ¤Ï¡¢¥³¥Þ¥ó¥ÉÆâ¤Ç¼Â¹Ô¤·¤¿ºÇ¸å¤ÎÃ±½ã¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ëÃÍ¤Ç¤¹¡£

for name [ in word ... ] do list done
for¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢for¥³¥Þ¥ó¥É¤Î¥ï¡¼¥É¥ê¥¹¥ÈÃæ¤Î¼¡¤Î¥ï¡¼¥É¤¬name¤Ë¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£in word ... ¤ò¾ÊÎ¬¤¹¤ë¤È¡¢Âå¤ï¤ê¤Ë in "$@" ¤¬¥ï¡¼¥É¥ê¥¹¥È¤È¤·¤ÆÁÛÄê¤µ¤ì¤Þ¤¹¡£¥ï¡¼¥É¥ê¥¹¥ÈÃæ¤Ë¥ï¡¼¥É¤¬¤Ê¤¯¤Ê¤ë¤È¡¢¼Â¹Ô¤Ï½ªÎ»¤·¤Þ¤¹¡£

case word in [ pattern [ | pattern ] ... ) list ;; ] ... esac
case¥³¥Þ¥ó¥É¤Ï¡¢word ¤Ë°ìÃ×¤¹¤ëºÇ½é¤Î pattern ¤òÁª¤Ó¡¢¤½¤Î pattern ¤ËÂÐ±þ¤¹¤ë list¤ò¼Â¹Ô¤·¤Þ¤¹¡£pattern ¤Î·Á¼°¤Ï¡¢¥Õ¥¡¥¤¥ëÌ¾¤ÎÀ¸À®¤ËÍÑ¤¤¤é¤ì¤ë¤â¤Î¤ÈÆ±¤¸¤Ç¤¹¡£

if list then list [ elif list then list ] ... [ else list ] fi
if¥³¥Þ¥ó¥É¤Ï¡¢if ¤Ë¸åÂ³¤¹¤ë list ¤ò¼Â¹Ô¤·¤Æ¡¢¤½¤Î list ¤¬¥¼¥í¤òÊÖ¤¹¾ì¹ç¤Ë¤Ï¡¢then ¤Ë¸åÂ³¤¹¤ë list ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢elif ¤Ë¸åÂ³¤¹¤ëlist ¤¬¼Â¹Ô¤µ¤ì¡¢¤½¤ÎÃÍ¤¬¥¼¥í¤Ç¤¢¤ì¤Ð¡¢then ¤Ë¸åÂ³¤¹¤ë list ¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¤³¤ì¤é¤Î½èÍý¤¬¤¹¤Ù¤Æ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢else list ¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£

while list [ do list ] done
while¥³¥Þ¥ó¥É¤Ï¡¢while list ¤ò·«¤êÊÖ¤·¼Â¹Ô¤·¡¢¤½¤Î list ¤ÎÊÖ¤¹ÃÍ¤¬¥¼¥í¤Ç¤¢¤ì¤Ð¡¢ do list ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¡¢¥ë¡¼¥×¤Ï½ªÎ»¤·¤Þ¤¹¡£while¥³¥Þ¥ó¥É¤ÎÊÖ¤¹ÃÍ¤Ï¡¢ do list  Æâ¤ÎºÇ¸å¤Ë¼Â¹Ô¤µ¤ì¤¿¥³¥Þ¥ó¥É¤¬ÊÖ¤¹ÃÍ¤Ç¤¹¡£ until ¤ò while ¤ËÂå¤ï¤ê¤Ë»ÈÍÑ¤·¤Æ¡¢¥ë¡¼¥×½ªÎ»¥Æ¥¹¥È¤ÎÃÍ¤òÈ¿Å¾¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

( list )
list ¤ò¥µ¥Ö¥·¥§¥ë¤Ç¼Â¹Ô¤·¤Þ¤¹¡£

{ list }
list ¤¬Ã±¤Ë¼Â¹Ô¤µ¤ì¤Þ¤¹¡£

°Ê²¼¤Î¥ï¡¼¥É¤Ï¡¢¥³¥Þ¥ó¥É¤ÎºÇ½é¤Î¥ï¡¼¥É¤Ç¤¢¤ê¡¢¤«¤Ä¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤À¤±Ç§¼±¤µ¤ì¤Þ¤¹¡£

if then else elif fi case in esac for while until do done { }

¡Î¥³¥Þ¥ó¥ÉÃÖ´¹¡Ï
¥Ð¥Ã¥¯¥¯¥©¡¼¥È¤Î¥Ú¥¢¡Ê``¡Ë¤Ç°Ï¤Þ¤ì¤¿¥³¥Þ¥ó¥É¤«¤é¤ÎÉ¸½à½ÐÎÏ¤Ï¡¢¥ï¡¼¥É¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤È¤·¤Æ»ÈÍÑ¤Ç¤­¤Þ¤¹¡£¤½¤ÎºÝ¡¢°ú¤­Â³¤¤¤Æ¸½¤ì¤ë²þ¹Ô¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£

¡Î¥Ñ¥é¥á¡¼¥¿ÃÖ´¹¡Ï
Ê¸»ú $ ¤Ï¡¢¥Ñ¥é¥á¡¼¥¿¤ÎÃÖ´¹¤òÆ³¤¯¤¿¤á¤Ë»ÈÍÑ¤·¤Þ¤¹¡£°ÌÃÖ¥Ñ¥é¥á¡¼¥¿¤Ï¡¢ set¥³¥Þ¥ó¥É¤ÇÃÍ¤òÂåÆþ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ÊÑ¿ô¤Ï¡¢

    name=value [ name=value ] ...

¤Î¤è¤¦¤Ë½ñ¤¤¤Æ¥»¥Ã¥È¤Ç¤­¤Þ¤¹¡£

${parameter}
parameter¤È¤Ï¡¢Ê¸»ú¡¢¿ô»ú¡¢¥¢¥ó¥À¡¼¥¹¥³¥¢¡Ê_¡Ë¤ÎÎó¡Êname¤È¤¤¤¤¤Þ¤¹¡Ë¡¢¿ô»ú1Ê¸»ú¡¢¤Þ¤¿¤Ï * @  # ? - $ ! ¤ÎÃæ¤ÎÇ¤°Õ¤Î1Ê¸»ú¤Î¤¤¤º¤ì¤«¤Ç¤¹¡£parameter¤¬ÃÍ¤ò»ý¤Ä¾ì¹ç¤Ë¤Ï¡¢ÃÖ´¹¤µ¤ì¤Þ¤¹¡£Ãæ¤«¤Ã¤³¡Ê{}¡Ë¤Ï¡¢parameter¤Î¸å¤Ë¡¢¡Ê¤½¤Î¥Ñ¥é¥á¡¼¥¿¤ÎÌ¾Á°¡Êname¡Ë¤Î°ìÉô¤Ç¤Ï¤Ê¤¤¡ËÊ¸»ú¡¢¿ô»ú¡¢¥¢¥ó¥À¡¼¥¹¥³¥¢¤¬Â³¤¯¾ì¹ç¤Ë¤À¤±É¬Í×¤È¤Ê¤ê¤Þ¤¹¡£parameter¤¬ * ¤Þ¤¿¤Ï @ ¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢$1 ¤«¤é»Ï¤Þ¤ë¤¹¤Ù¤Æ¤Î°ÌÃÖ¥Ñ¥é¥á¡¼¥¿¤ò¡Ê¶õÇòÊ¸»ú¤Ç¶èÀÚ¤Ã¤Æ¡ËÃÖ´¹¤·¤Þ¤¹¡£ $0 ¤Ë¤Ï¡¢¥·¥§¥ë¤¬µ¯Æ°¤µ¤ì¤¿¤È¤­¤Î0ÈÖÌÜ¤Î°ú¿ô¤¬¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£

${parameter-word}
parameter¤ËÃÍ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢¤½¤ÎÃÍ¤ÇÃÖ´¹¤·¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢word¤ÇÃÖ´¹¤·¤Þ¤¹¡£

${parameter=word}
parameter¤ËÃÍ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¡¢parameter¤Ëword¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢¥Ñ¥é¥á¡¼¥¿¤ÎÃÍ¤¬ÃÖ´¹¤µ¤ì¤Þ¤¹¡£°ÌÃÖ¥Ñ¥é¥á¡¼¥¿¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¤è¤¦¤ÊÊýË¡¤ÇÂåÆþ¤Ç¤­¤Þ¤»¤ó¡£

${parameter?word}
parameter¤ËÃÍ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤½¤ÎÃÍ¤ÇÃÖ´¹¤·¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢word¤òÉ½¼¨¤·¤Æ¥·¥§¥ë¤ò½ªÎ»¤·¤Þ¤¹¡£word¤ò¾ÊÎ¬¤·¤¿¾ì¹ç¤Ë¤Ï¡¢·Ù¹ð¤Î¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£

${parameter+word}
parameter¤ËÃÍ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢word¤ÇÃÖ´¹¤·¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢¤Ê¤Ë¤âÃÖ´¹¤·¤Þ¤»¤ó¡£

°Ê¾å¤Î¹½Ê¸¤Ç¤Ï¡¢word¤¬É¾²Á¤µ¤ì¤ë¤Î¤Ï¡¢word¤¬ÃÖ´¹Ê¸»úÎó¤È¤·¤Æ»ÈÍÑ¤µ¤ì¤ë¾ì¹ç¤Ë¸Â¤ê¤Þ¤¹¡£¡Ê¤·¤¿¤¬¤Ã¤Æ¡¢Îã¤¨¤Ð¡¢echo ${d-`pwd`} ¤Ï¡¢d¤ËÃÍ¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Î¤ß¡¢ pwd¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¡Ë

°Ê²¼¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢³Æ¥·¥§¥ë¤¬¼«Æ°Åª¤ËºÆÀßÄê¤·¤Þ¤¹¡£

#	°ÌÃÖ¥Ñ¥é¥á¡¼¥¿¤Î¿ô¤Ç¤¹¡£¡Ê10¿Ê¿ô¡Ë
-	µ¯Æ°»þ¤Ë¥·¥§¥ë¤ËÅÏ¤µ¤ì¤ë¥ª¥×¥·¥ç¥ó¤«¡¢ set¤ÇÀßÄê¤µ¤ì¤ë¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£    
?	ºÇ¸å¤Ë¼Â¹Ô¤µ¤ì¤¿¥³¥Þ¥ó¥É¤¬ÊÖ¤¹10¿Ê¿ô¤Ç¤¹¡£
$	¤³¤Î¥·¥§¥ë¤Î¥×¥í¥»¥¹idÈÖ¹æ¤Ç¤¹¡£¡Ê¥×¥í¥»¥¹idÈÖ¹æ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ps(1),  fork(2), getpid(2)¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ë
!	ºÇ¸å¤Ëµ¯Æ°¤·¤¿¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¥³¥Þ¥ó¥É¤Î¥×¥í¥»¥¹idÈÖ¹æ¤Ç¤¹¡£
    
°Ê²¼¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢³Æ¥·¥§¥ë¤¬»ÈÍÑ¤·¤Þ¤¹¤¬¡¢É¬¤º¤·¤âºÆÀßÄê¤¹¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

HOME	cd¥³¥Þ¥ó¥É¤Î¥Ç¥Õ¥©¥ë¥È¤Î°ú¿ô¤Ç¤¹¡£¡Ê¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò¼¨¤·¤Þ¤¹¡Ë
    
PATH	¥³¥Þ¥ó¥É¤Î¥µ¡¼¥Á¥Ñ¥¹¤Ç¤¹¡£¡Ê¾Ü¤·¤¯¤Ï¡¢¼Â¹Ô¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡Ë
  
MAIL	¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¥á¡¼¥ë¥Õ¥¡¥¤¥ë¤ÎÌ¾Á°¡Êname¡Ë¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥·¥§¥ë¤Ï¡¢»ØÄê¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¥á¡¼¥ë¤¬ÅþÃå¤¹¤ë¤È¡¢¥æ¡¼¥¶¤ËÄÌÃÎ¤·¤Þ¤¹¡£
   
PS1	°ì¼¡¥×¥í¥ó¥×¥ÈÊ¸»úÎó¤Ç¤¹¡£¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï '$ ' ¤Ç¤¹¡£
    
PS2	Æó¼¡¥×¥í¥ó¥×¥ÈÊ¸»úÎó¤Ç¤¹¡£¥Ç¥Õ¥©¥ë¥È¤ÎÃÍ¤Ï '> ' ¤Ç¤¹¡£
    
IFS	ÆâÉô¥Õ¥£¡¼¥ë¥ÉÊ¬Î¥Ê¸»ú¡Ê Internal field separators¡Ë¤Ç¤¹¡£ÄÌ¾ï¤Ï¡¢¶õÇòÊ¸»ú¡¢¥¿¥Ö¡¢²þ¹Ô¤Ç¤¹¡£ IFS ¤¬Ìµ»ë¤µ¤ì¤ë¤Î¤Ï¡¢ sh ¤¬ root ¤È¤·¤ÆÁö¹Ô¤·¤Æ¤¤¤ë¾ì¹ç¡¢¤â¤·¤¯¤Ï¼Â¹Ô¥æ¡¼¥¶id¡Ê effective user id ¡Ë¤¬¼Â¥æ¡¼¥¶id¡Ê real user id ¡Ë¤È°Û¤Ê¤ë¾ì¹ç¤Ç¤¹¡£¡Ê ¼Â¹Ô¥æ¡¼¥¶id¤È¼Â¥æ¡¼¥¶id¤Ë¤Ä¤¤¤Æ¤Ï¡¢getuid(2)¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ë
    
¡Î¥Ö¥é¥ó¥¯¤Î²ò¼á¡Ï
¥Ñ¥é¥á¡¼¥¿¤ä¥³¥Þ¥ó¥É¤¬ÃÖ´¹¤µ¤ì¤¿¸å¡¢ÃÖ´¹¤µ¤ì¤¿·ë²Ì¤Ï¡¢ÆâÉô¥Õ¥£¡¼¥ë¥ÉÊ¬Î¥Ê¸»ú¡Ê$IFS ¤ÎÃæ¤Ë¸«¤Ä¤«¤ë¤â¤Î¡Ë¤ò´Þ¤à¤«¤É¤¦¤«¥¹¥­¥ã¥ó¤µ¤ì¤Þ¤¹¡£ÆâÉô¥Õ¥£¡¼¥ë¥ÉÊ¬Î¥Ê¸»ú¤¬¸«¤Ä¤«¤ì¤Ð¡¢¤½¤³¤ÇÊÌ¡¹¤Î°ú¿ô¤ËÊ¬³ä¤µ¤ì¤Þ¤¹¡£ÌÀ¼¨Åª¤Ê¥Ì¥ë°ú¿ô¡Ê"" ¤ä ''¡Ë¤ÏÊÝÂ¸¤µ¤ì¤Þ¤¹¡£°ÅÌÛ¤Î¥Ì¥ë°ú¿ô¡ÊÃÍ¤Î¤Ê¤¤parameter¤ÎÃÖ´¹¤Ë¤è¤ë¤â¤Î¡Ë¤Ï¡¢ºï½ü¤µ¤ì¤Þ¤¹¡£

¡Î¥Õ¥¡¥¤¥ëÌ¾¤ÎÀ¸À®¡Ï
¥³¥Þ¥ó¥É¤Î¼Â¹ÔÁ°¤Ë¡¢¤½¤ì¤¾¤ì¤Î¥³¥Þ¥ó¥É¤Î¥ï¡¼¥É¤Ï¡¢Ê¸»ú *, ?, [ ¤ò´Þ¤à¤«¤É¤¦¤«¥¹¥­¥ã¥ó¤µ¤ì¤Þ¤¹¡£¤³¤ì¤é¤ÎÊ¸»ú¤Î¤¤¤º¤ì¤«¤¬¸«¤Ä¤«¤ì¤Ð¡¢¤½¤Î¥ï¡¼¥É¤Ï¥Ñ¥¿¡¼¥ó¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£¤½¤ÎºÝ¡¢¥ï¡¼¥É¤Ï¡¢¡Ê¤½¤Î¥Ñ¥¿¡¼¥ó¤Ë°ìÃ×¤¹¤ë¡Ë¼­½ñ½ç¤Ë¥½¡¼¥È¤·¤¿¥Õ¥¡¥¤¥ëÌ¾¤ÇÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£¥Ñ¥¿¡¼¥ó¤Ë°ìÃ×¤¹¤ë¥Õ¥¡¥¤¥ëÌ¾¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¥ï¡¼¥É¤ÏÉÔÊÑ¤Ç¤¹¡£¥Õ¥¡¥¤¥ëÌ¾¤ÎÀèÆ¬¤ÎÊ¸»ú . ¤È¡¢Ê¸»ú / ¤ÎÄ¾¸å¤Ë¤¢¤ëÊ¸»ú . ¡¢¤Þ¤¿¤ÏÊ¸»ú / ¤Ï¡¢¥Ñ¥¿¡¼¥ó¤ËÌÀ¼¨Åª¤Ë°ìÃ×¤µ¤»¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£

*	 ¡Ê¥Ì¥ëÊ¸»úÎó¤ò´Þ¤á¤Æ¡ËÇ¤°Õ¤ÎÊ¸»úÎó¤Ë°ìÃ×¤·¤Þ¤¹¡£
?	 Ç¤°Õ¤Î1Ê¸»ú¤Ë°ìÃ×¤·¤Þ¤¹¡£
[...]	 °Ï¤Þ¤ì¤¿Ê¸»ú¤ÎÃæ¤ÎÇ¤°Õ¤Î1Ê¸»ú¤È°ìÃ×¤·¤Þ¤¹¡£ - ¤ÇÊ¬Î¥¤µ¤ì¤¿Ê¸»ú¤Î¥Ú¥¢¤Ï¡¢¥Ú¥¢¤Î´Ö¤ÎÇ¤°Õ¤Î1Ê¸»ú¡Ê¼­½ñ½ç¡Ë¤È°ìÃ×¤·¤Þ¤¹¡£

¡Î¥¯¥©¡¼¥È¡Ï
°Ê²¼¤ÎÊ¸»ú¤Ï¡¢¥·¥§¥ë¤ËÂÐ¤·¤ÆÆÃ¼ì¤Ê°ÕÌ£¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£°Ê²¼¤ÎÊ¸»ú¤Ï¡¢¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥ï¡¼¥É¤Î¶èÀÚ¤ê¤ò°ÕÌ£¤·¤Þ¤¹¡£

;   &   (   )   |   <   >   ²þ¹Ô   ¶õÇòÊ¸»ú  ¥¿¥Ö

Ç¤°Õ¤Î1Ê¸»ú¤Ï¡¢¤½¤ÎÁ°¤Ë \ ¤òÉÕ¤±¤Æ¥¯¥©¡¼¥È¤Ç¤­¤Þ¤¹¡£²þ¹Ô¤ÎÁ°¤Ë \ ¤òÉÕ¤±¤ë¤È¡¢Ìµ»ë¤µ¤ì¤Þ¤¹¡£Ç¤°Õ¤ÎÊ¸»úÎó¤Ï¡¢Ã±°ì°úÍÑÉä¤Î¥Ú¥¢¡Ê''¡Ë¤Ç°Ï¤à¤È¡¢¥¯¥©¡¼¥È¤µ¤ì¤Þ¤¹¡£¡Ê¤¿¤À¤·¡¢Ã±°ì°úÍÑÉä¼«¿È¤Î¾ì¹ç¤Ï½ü¤­¤Þ¤¹¡£¡ËÆó½Å°úÍÑÉäÊ¸»ú¤Î¥Ú¥¢¡Ê""¡Ë¤Ç°Ï¤Þ¤ì¤ë¤È¡¢¥Ñ¥é¥á¡¼¥¿¤ª¤è¤Ó¥³¥Þ¥ó¥É¤ÎÃÖ´¹¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¤½¤ÎºÝ¡¢Æó½Å°úÍÑÉäÊ¸»ú¤Î¥Ú¥¢¤Ç°Ï¤Þ¤ì¤¿ \ ' " $ ¤ò¥¯¥©¡¼¥È¤¹¤ë¤Ë¤Ï¡¢¤½¤ÎÁ°¤Ë \ ¤òÉÕ¤±¤Þ¤¹¡£

"$*" ¤Ï¡¢ "$1 $2 ..." ¤ÈÆ±ÃÍ¤Ç¤¹¡£¤Þ¤¿¡¢
"$@" ¤Ï¡¢ "$1" "$2" ... ¤ÈÆ±ÃÍ¤Ç¤¹¡£

¡Î¥×¥í¥ó¥×¥È¡ÊÆþÎÏÂ¥¿Êµ­¹æ¡Ë¡Ï
¥·¥§¥ë¤Ï¡¢ÂÐÏÃ·¿¡Êinteractive¡Ë¤Ç»ÈÍÑ¤µ¤ì¤ë¾ì¹ç¡¢¥³¥Þ¥ó¥É¤òÆÉ¤ß¼è¤ëÁ°¤Ë PS1 ¤ÎÃÍ¤ò¥×¥í¥ó¥×¥È¤ËÉ½¼¨¤·¤Þ¤¹¡£²þ¹Ô¤¬ÆþÎÏ¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢¥³¥Þ¥ó¥É¤ò´°·ë¤µ¤»¤ë¤¿¤á¤Î¼¡¤ÎÆþÎÏ¤¬É¬Í×¤Ê¾ì¹ç¤Ë¤Ï¡¢Æó¼¡¥×¥í¥ó¥×¥È¡Ê$PS2¡Ë¤¬½ÐÎÏ¤µ¤ì¤Þ¤¹¡£
    
¡ÎÆþÎÏ¡¦½ÐÎÏ¡Ï
¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤ëÁ°¤Ë¡¢¤½¤ÎÆþÎÏ¤È½ÐÎÏ¤ò¡¢¥·¥§¥ë¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤ëÆÃ¼ìµ­Ë¡¤ò»ÈÍÑ¤·¤Æ¡¢¥ê¥À¥¤¥ì¥¯¥È¡Êredirect¡Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£°Ê²¼¤Î¹½Ê¸¤Ï¡¢Ã±½ã¥³¥Þ¥ó¥É¤Î¤É¤Î¾ì½ê¤ËÃÖ¤¤¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£¤Þ¤¿¡¢¥³¥Þ¥ó¥É¤ËÀè¹Ô¤·¤¿¤ê¸åÂ³¤·¤¿¤ê¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£¤µ¤é¤Ë¡¢µ¯Æ°¤·¤¿¥³¥Þ¥ó¥É¤ËÅÏ¤µ¤ì¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£word¤ädigit¤¬»ÈÍÑ¤µ¤ì¤ëÁ°¤Ë¡¢ÃÖ´¹¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£

<word
É¸½àÆþÎÏ¡Ê¥Õ¥¡¥¤¥ëµ­½Ò»Ò0¡Ë¤È¤·¤Æ¡¢¥Õ¥¡¥¤¥ëword¤ò»ÈÍÑ¤·¤Þ¤¹¡£

>word
É¸½à½ÐÎÏ¡Ê¥Õ¥¡¥¤¥ëµ­½Ò»Ò1¡Ë¤È¤·¤Æ¡¢¥Õ¥¡¥¤¥ëword¤ò»ÈÍÑ¤·¤Þ¤¹¡£¤½¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬¿·µ¬¤ËºîÀ®¤µ¤ì¤Þ¤¹¡£¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ÆâÍÆ¤òÀÚ¤ê¼Î¤Æ¡¢¥Õ¥¡¥¤¥ëÄ¹¤ò¥¼¥í¤Ë¤·¤Þ¤¹¡£

>>word
É¸½à½ÐÎÏ¤È¤·¤Æ¡¢¥Õ¥¡¥¤¥ëword¤ò»ÈÍÑ¤·¤Þ¤¹¡£¤½¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¡Ê¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Þ¤Ç¥·¡¼¥¯¤·¤Æ¡Ë¡¢½ÐÎÏ¤¬¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤ËÄÉ²Ã¤µ¤ì¤Þ¤¹¡£¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬¿·µ¬¤ËºîÀ®¤µ¤ì¤Þ¤¹¡£

<<word
¥·¥§¥ëÆþÎÏ¤¬¡¢word¤ÈÆ±°ì¤Î¹Ô¤¬¸½¤ì¤ë¤Þ¤Ç¡Ê¤Þ¤¿¤Ï¥¨¥ó¥É¡¦¥ª¥Ö¡¦¥Õ¥¡¥¤¥ë¤Þ¤Ç¡Ë¡¢ÆÉ¤ß¼è¤é¤ì¤Þ¤¹¡£¤½¤Î·ë²Ì¤È¤·¤ÆÆÀ¤é¤ì¤¿¥É¥­¥å¥á¥ó¥È¤¬É¸½àÆþÎÏ¤Ë¤Ê¤ê¤Þ¤¹¡£word¤ÎÃæ¤ÎÇ¤°Õ¤Î1Ê¸»ú¤¬¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥É¥­¥å¥á¥ó¥ÈÆâ¤ÎÊ¸»úÎó¤ËÂÐ¤·¤Æ¤¤¤«¤Ê¤ë²ò¼á¤â¤ª¤³¤Ê¤ï¤ì¤Þ¤»¤ó¡£¥¯¥©¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¡Ê¥É¥­¥å¥á¥ó¥ÈÆâ¤ÎÊ¸»úÎó¤ËÂÐ¤·¤Æ¡Ë¥Ñ¥é¥á¡¼¥¿¤È¥³¥Þ¥ó¥É¤ÎÃÖ´¹¤¬¼Â¹Ô¤µ¤ì¡¢\²þ¹Ô ¤¬Ìµ»ë¤µ¤ì¤Þ¤¹¡£¤½¤ÎºÝ¡¢\ ¤ò»ÈÍÑ¤·¤Æ¡¢Ê¸»ú \ $ ' ¤ò¥¯¥©¡¼¥È¤·¤¿¤ê¡¢¡Ê¥É¥­¥å¥á¥ó¥ÈÆâ¤Îword¤½¤Î¤â¤Î¤ò¥¯¥©¡¼¥È¤¹¤ë¤¿¤á¡Ëword¤ÎºÇ½é¤Î1Ê¸»ú¤ò¥¯¥©¡¼¥È¤·¤¿¤ê¤Ç¤­¤Þ¤¹¡£

<&digit
É¸½àÆþÎÏ¤¬¡¢¥Õ¥¡¥¤¥ëµ­½Ò»Òdigit¤«¤éÊ£À½¤µ¤ì¤Þ¤¹¡Ê¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢dup(2)¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡Ë¡£ > ¤ò»ÈÍÑ¤¹¤ì¤Ð¡¢É¸½à½ÐÎÏ¤ËÂÐ¤·¤Æ¤âÆ±ÍÍ¤Ê½èÍý¤ò¤ª¤³¤Ê¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

<&-	
É¸½àÆþÎÏ¤¬¥¯¥í¡¼¥º¤µ¤ì¤Þ¤¹¡£ > ¤ò»ÈÍÑ¤¹¤ì¤Ð¡¢É¸½à½ÐÎÏ¤ËÂÐ¤·¤Æ¤âÆ±ÍÍ¤Ê½èÍý¤ò¤ª¤³¤Ê¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

¾åµ­¤Î¹½Ê¸¤ÎÁ°¤Ë¿ô»ú¤òÉÕ¤±¤ë¤È¡¢ºîÀ®¡Êcreate¡Ë¤µ¤ì¤ë¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Ï¡¢¡Ê¥Ç¥Õ¥©¥ë¥È¤Î0¤Þ¤¿¤Ï1¤Î¤«¤ï¤ê¤Ë¡Ë¤½¤Î¿ô»ú¤Ç»ØÄê¤µ¤ì¤ë¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢

... 2>&1

¤Ï¡¢¥Õ¥¡¥¤¥ëµ­½Ò»Ò2¤ò¥Õ¥¡¥¤¥ëµ­½Ò»Ò1¤ÎÊ£À½¤È¤·¤ÆºîÀ®¤·¤Þ¤¹¡£

¥³¥Þ¥ó¥É¤Î¸å¤Ë & ¤òÉÕ¤±¤ë¤È¡¢¤½¤Î¥³¥Þ¥ó¥É¤ËÂÐ¤¹¤ë¥Ç¥Õ¥©¥ë¥È¤ÎÉ¸½àÆþÎÏ¤Ï¡¢¶õ¤Î¥Õ¥¡¥¤¥ë¡Ê/dev/null¡Ë¤Ë¤Ê¤ê¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢¥³¥Þ¥ó¥É¤Î¼Â¹Ô´Ä¶­¤Ï¡¢µ¯Æ°¤·¤¿¥·¥§¥ë¤Î¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤òÆþÎÏ¡¦½ÐÎÏ»ØÄê¤ÇÊÑ¹¹¤·¤¿¤â¤Î¤ò´Þ¤ß¤Þ¤¹¡£

¡Î´Ä¶­¡Êenvironment¡Ë¡Ï
´Ä¶­¤È¤Ï¡¢name¤Èvalue¤Î¥Ú¥¢¤«¤é¤Ê¤ë¥ê¥¹¥È¤Ç¡¢ÄÌ¾ï¤Î°ú¿ô¥ê¥¹¥È¤ÈÆ±¤¸ÊýË¡¤Ç¼Â¹Ô¥×¥í¥°¥é¥à¤ËÅÏ¤µ¤ì¤ë¤â¤Î¤Ç¤¹¡£¡Ê¾Ü¤·¤¯¤Ï¡¢execve(2)¤Èenviron(7)¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ë¥·¥§¥ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ê¿ô¼ïÎà¤ÎÊýË¡¤Ç´Ä¶­¤ÈÁê¸ßºîÍÑ¤·¤Þ¤¹¡£µ¯Æ°»þ¤Ë¡¢¥·¥§¥ë¤Ï´Ä¶­¤ò¥¹¥­¥ã¥ó¤·¤Æ¡¢¸«¤Ä¤±¤¿³Æname¤ËÂÐ¤·¤½¤ì¤¾¤ì¥Ñ¥é¥á¡¼¥¿¤òºîÀ®¤·¡¢¤½¤ì¤ËÂÐ±þ¤¹¤ëvalue¤òÍ¿¤¨¤Þ¤¹¡£¼Â¹Ô¤µ¤ì¤ë¥³¥Þ¥ó¥É¤Ï¡¢¥·¥§¥ë¤ÈÆ±°ì¤Î´Ä¶­¤ò·Ñ¾µ¤·¤Þ¤¹¡£¥æ¡¼¥¶¤¬¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Îvalue¤òÊÑ¹¹¤·¤¿¤ê¡¢¿·¤·¤¤¥Ñ¥é¥á¡¼¥¿¤òºîÀ®¤·¤¿¤ê¤·¤¿¾ì¹ç¡¢¤½¤ÎÊÑ¹¹¤ò´Ä¶­¤ËÈ¿±Ç¤µ¤»¤ë¤Ë¤Ï¡¢export¥³¥Þ¥ó¥É¤ò»ÈÍÑ¤·¤Æ¥·¥§¥ë¤Î¥Ñ¥é¥á¡¼¥¿¤ò´Ä¶­¤ËÁÈ¤ß¹þ¤Þ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤·¤¿¤¬¤Ã¤Æ¡¢¼Â¹Ô¤µ¤ì¤ë¥³¥Þ¥ó¥É¤¬»²¾È¤¹¤ë´Ä¶­¤Ï¡¢¤â¤È¤â¤È¤Î¥·¥§¥ë¤«¤é·Ñ¾µ¤·¤¿name¤Èvalue¤Î¥Ú¥¢¤ÎÊÑ¹¹¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤È¡¢ÊÑ¹¹¤Þ¤¿¤ÏÄÉ²Ã¤µ¤ì¤¿¤â¤Î¤Ç¡¢export¥³¥Þ¥ó¥É¤ÇÄÌÃÎ¤µ¤ì¤¿¤â¤Î¤Î¤¤¤º¤ì¤«¤Ë¤Ê¤ê¤Þ¤¹¡£

Ã±½ã¥³¥Þ¥ó¥É¤ËÂÐ¤¹¤ë´Ä¶­¤Ï¡¢¥³¥Þ¥ó¥É¤ÎÁ°¤Ç¥Ñ¥é¥á¡¼¥¿¤ØÂåÆþ¤·¤ÆÁý¤ä¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤·¤¿¤¬¤Ã¤Æ¡¢¼¡¤Î2¹Ô¤ÏÆ±ÃÍ¤Ç¤¹¡£

TERM=450 cmd args
(export TERM; TERM=450; cmd args)

-k ¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤Î¥­¡¼¥ï¡¼¥É°ú¿ô¤¬¡Ê¤½¤ì¤¬¥³¥Þ¥ó¥ÉÌ¾¤Î¸å¤ÇÈ¯À¸¤·¤¿¾ì¹ç¤Ç¤â¡Ë¡¢´Ä¶­¤ËÃÖ¤«¤ì¤Þ¤¹¡£°Ê²¼¤ÎÎã¤Ï¡¢'a=b c' ¤È 'c' ¤ò½ÐÎÏ¤·¤Þ¤¹¡£

echo a=b c
set -k
echo a=b c

¡Î¥·¥°¥Ê¥ë¡Ï
µ¯Æ°¤µ¤ì¤¿¥³¥Þ¥ó¥É¤ËÂÐ¤¹¤ëINTERRUPT¥·¥°¥Ê¥ë¤È QUIT¥·¥°¥Ê¥ë¤Ï¡¢¥³¥Þ¥ó¥É¤Î¸å¤Ë & ¤¬ÉÕ¤¤¤Æ¤¤¤ë¾ì¹ç¤Ë¤ÏÌµ»ë¤µ¤ì¤Þ¤¹¡£¤½¤ÎÂ¾¤Î¾ì¹ç¤Ë¤Ï¡¢¥·¥°¥Ê¥ë¤Ï¡¢¥·¥§¥ë¤¬¿Æ¤«¤é·Ñ¾µ¤·¤¿ÃÍ¤ò»ý¤Á¤Þ¤¹¡Ê¤¿¤À¤·¡¢trap¥³¥Þ¥ó¥É¤Î¹à¤â»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡Ë¡£

¡Î¼Â¹Ô¡ÊExecution¡Ë¡Ï
¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢¾åµ­¤ÎÃÖ´¹¤¬¿ë¹Ô¤µ¤ì¤Þ¤¹¡£¤½¤ÎºÝ¡¢¿·¤·¤¤¥×¥í¥»¥¹¤¬ºîÀ®¤µ¤ì¡¢execve(2)¤Ë¤è¤Ã¤Æ¤½¤Î¥³¥Þ¥ó¥É¤Î¼Â¹Ô¤¬»î¤ß¤é¤ì¤Þ¤¹¡£¡Ê¤¿¤À¤·¡¢²¼µ­¤Ë½Ò¤Ù¤ë 'ÆÃ¼ì¥³¥Þ¥ó¥É' ¤Î¾ì¹ç¤ÏÎã³°¤Ç¤¹¡Ë¡£

¥·¥§¥ë¥Ñ¥é¥á¡¼¥¿ $PATH ¤Ï¡¢¥³¥Þ¥ó¥É¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î¥µ¡¼¥Á¥Ñ¥¹¤òÄêµÁ¤·¤Þ¤¹¡£Ï¢Â³¤¹¤ë¥Ç¥£¥ì¥¯¥È¥êÌ¾¤Ï¡¢¥³¥í¥ó¡Ê:¡Ë¤Ç¶èÀÚ¤é¤ì¤Þ¤¹¡£¥³¥Þ¥ó¥ÉÌ¾¤¬ / ¤ò´Þ¤à¾ì¹ç¤Ë¤Ï¡¢¥µ¡¼¥Á¥Ñ¥¹¤Ï»ÈÍÑ¤µ¤ì¤Þ¤»¤ó¡£¤½¤ÎÂ¾¤Î¾ì¹ç¤Ë¤Ï¡¢¥Ñ¥¹Æâ¤Î³Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¼Â¹Ô²ÄÇ½¥Õ¥¡¥¤¥ë¤ò´Þ¤à¤«¤É¤¦¤«¥µ¡¼¥Á¤µ¤ì¤Þ¤¹¡£¥Õ¥¡¥¤¥ë¤¬¼Â¹Ô²ÄÇ½¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò»ý¤Á¡¢a.out¥Õ¥¡¥¤¥ë¡ÊMach-O(5)»²¾È¡Ë¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ï¥·¥§¥ë¥³¥Þ¥ó¥É¤ò´Þ¤à¥Õ¥¡¥¤¥ë¤ÈÁÛÄê¤µ¤ì¤Þ¤¹¡£¤½¤ÎºÝ¡¢¥µ¥Ö¥·¥§¥ë¡Ê¤¹¤Ê¤ï¤Á¡¢ÊÌ¤Î¥×¥í¥»¥¹¡Ë¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¼è¤ë¤¿¤á¤Ë¡¢µ¯Æ°¡Êspawn¡Ë¤µ¤ì¤Þ¤¹¡£¤«¤Ã¤³¤Ç°Ï¤Þ¤ì¤¿¥³¥Þ¥ó¥É¤â¡¢¥µ¥Ö¥·¥§¥ë¤Ç¼Â¹Ô¤µ¤ì¤Þ¤¹¡£

¡ÎÆÃ¼ì¥³¥Þ¥ó¥É¡Ï
°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥·¥§¥ë¥×¥í¥»¥¹¤ÎÃæ¤Ç¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¤·¤¿¤¬¤Ã¤Æ¡¢²¼µ­¤Î¥³¥Þ¥ó¥É¤ËÂÐ¤·¤Æ¤Ï¡¢¿·¤·¤¤¥×¥í¥»¥¹¤ÏºîÀ®¤µ¤ì¤Þ¤»¤ó¡£

#	 # ¤Ë¸åÂ³¤¹¤ëÊ¸»úÎó¤Ï¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£¤¹¤Ê¤ï¤Á¡¢¤½¤Î¹Ô¤Î»Ä¤ê¤ÏÌµ»ë¤µ¤ì¤Þ¤¹¡£

:	¤³¤Î¥³¥Þ¥ó¥É¤Ï²¿¤â¼Â¹Ô¤·¤Þ¤»¤ó¡£

. file
file ¤«¤é¥³¥Þ¥ó¥É¤òÆÉ¤ß¼è¤ê¡¢¼Â¹Ô¤·¤Æ¥ê¥¿¡¼¥ó¡Êreturn¡Ë¤·¤Þ¤¹¡£¥µ¡¼¥Á¥Ñ¥¹ $PATH ¤ò»ÈÍÑ¤·¤Æ¡¢file ¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò¸«¤Ä¤±¤Þ¤¹¡£

break [n]
¤½¤ì¤ò°Ï¤ó¤Ç¤¤¤ë for ¤Þ¤¿¤Ï while ¥ë¡¼¥×¤¬¤¢¤ì¤Ð¡¢¤½¤³¤«¤éÃ¦½Ð¤·¤Þ¤¹¡£n ¤ò»ØÄê¤¹¤ë¤È¡¢n ¥ì¥Ù¥ëÊ¬¤À¤±¥Ö¥ì¡¼¥¯¡Êbreak¡Ë¤·¤Þ¤¹¡£

continue [n]
¤½¤ì¤ò°Ï¤ó¤Ç¤¤¤ë for ¤Þ¤¿¤Ï while ¥ë¡¼¥×¤Î¼¡¤Î·«¤êÊÖ¤·¤«¤éºÆ³«¡Êresume¡Ë¤·¤Þ¤¹¡£n ¤ò»ØÄê¤¹¤ë¤È¡¢n ¸ÄÌÜ¤Î¥ë¡¼¥×¤«¤éºÆ³«¤·¤Þ¤¹¡£

cd [arg]
¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò arg ¤ËÊÑ¹¹¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Î arg ¤Ï¡¢¥·¥§¥ë¥Ñ¥é¥á¡¼¥¿ $HOME ¤Ç¤¹¡£

eval [arg ...]
°ú¿ô arg ... ¤¬¥·¥§¥ë¤Ø¤ÎÆþÎÏ¤È¤·¤ÆÆÉ¤ß¼è¤é¤ì¡¢¤½¤Î·ë²Ì¤È¤·¤ÆÆÀ¤é¤ì¤ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£

exec [arg ...]
°ú¿ô arg ... ¤Ë¤è¤Ã¤Æ»ØÄê¤µ¤ì¤ë¥³¥Þ¥ó¥É¤¬¡¢¿·¤·¤¤¥×¥í¥»¥¹¤òºîÀ®¤»¤º¤Ë¡¢¤³¤Î¥·¥§¥ë¤ÎÂå¤ï¤ê¤Ë¼Â¹Ô¤µ¤ì¤Þ¤¹¡£°ú¿ô¤ÇÆþÎÏ¡¦½ÐÎÏ¤ò»ØÄê¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤½¤ÎºÝ¡¢¤½¤ÎÂ¾¤Î°ú¿ô¤¬Í¿¤¨¤é¤ì¤Ê¤±¤ì¤Ð¡¢¤½¤Î¥·¥§¥ë¤ÎÆþÎÏ¡¦½ÐÎÏ¤¬½¤Àµ¤µ¤ì¤Þ¤¹¡£

exit [n]
n ¤Ç»ØÄê¤µ¤ì¤¿½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ç¡¢¥·¥§¥ë¤ò½ªÎ»¤µ¤»¤Þ¤¹¡£n ¤¬¾ÊÎ¬¤µ¤ì¤¿¾ì¹ç¡¢¥·¥§¥ë¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ï¡¢ºÇ¸å¤Ë¼Â¹Ô¤µ¤ì¤¿¥³¥Þ¥ó¥É¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ë¤Ê¤ê¤Þ¤¹¡£¡ÊÆ±ÍÍ¤Ë¡¢¥¨¥ó¥É¡¦¥ª¥Ö¡¦¥Õ¥¡¥¤¥ë¤Ë¤è¤Ã¤Æ¤â¥·¥§¥ë¤Ï½ªÎ»¤·¤Þ¤¹¡£¡Ë

export [name ...]
Í¿¤¨¤é¤ì¤¿ name ... ¤Ë¥Þ¡¼¥¯¤òÉÕ¤±¤Æ¡¢¥¨¥¯¥¹¥Ý¡¼¥ÈÊÑ¿ô¤Ë¤·¤Þ¤¹¡£¥¨¥¯¥¹¥Ý¡¼¥ÈÊÑ¿ô¤Ï¡¢°ú¤­Â³¤¤¤Æ¼Â¹Ô¤µ¤ì¤ë¥³¥Þ¥ó¥É¤Î´Ä¶­¤Ë¼«Æ°Åª¤Ë°ú¤­ÅÏ¤µ¤ì¤Þ¤¹¡£°ú¿ô¤¬Í¿¤¨¤é¤ì¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥¨¥¯¥¹¥Ý¡¼¥ÈÊÑ¿ô¤ÎÌ¾Á°¡Êname¡Ë¤Î¥ê¥¹¥È¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£

login [arg ...]
'exec login arg ...' ¤ÈÆ±ÃÍ¤Ç¤¹¡£¾Ü¤·¤¯¤Ï¡¢login(1) ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

read name ...
É¸½àÆþÎÏ¤«¤é1¹ÔÊ¬¤À¤±ÆÉ¤ß¼è¤ê¤Þ¤¹¡£¤½¤ÎºÝ¡¢ºÇ½é¤Î¥ï¡¼¥É¤Ë°ú¤­Â³¤­Ê£¿ô¤Î¥ï¡¼¥É¤¬ÆþÎÏ¤µ¤ì¤ë¤È¡¢¤½¤Î¥ï¡¼¥É¤Ï½çÈÖ¤ËÂÐ±þ¤¹¤ëÊÑ¿ô name ¤Ë³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£»Ä¤Ã¤¿¥ï¡¼¥É¤Ï¡¢ºÇ¸å¤ÎÊÑ¿ô¤Ë³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£¥¨¥ó¥É¡¦¥ª¥Ö¡¦¥Õ¥¡¥¤¥ë¤Ë»ê¤ë¾ì¹ç¤ò½ü¤­¡¢¥ê¥¿¡¼¥ó¥³¡¼¥É¤Ï¡¢0 ¤Ç¤¹¡£

readonly [name ...]
Í¿¤¨¤é¤ì¤¿ name ¤¬¥Þ¡¼¥¯¤µ¤ì¤Æ¡¢¥ê¡¼¥É¥ª¥ó¥ê¡¼¡Êreadonly¡Ë¤Ë¤Ê¤ê¤Þ¤¹¡£ ¥ê¡¼¥É¥ª¥ó¥ê¡¼¤Ë¤Ê¤Ã¤¿ name ¤ÎÃÍ¤Ï¡¢¤½¤Î¸å¡¢ÂåÆþ¤Ë¤è¤Ã¤ÆÊÑ¹¹¤µ¤ì¤Þ¤»¤ó¡£°ú¿ô¤¬Í¿¤¨¤é¤ì¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥ê¡¼¥É¥ª¥ó¥ê¡¼¤Ë¤Ê¤Ã¤¿Á´¤Æ¤Î name ¤Î¥ê¥¹¥È¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£

set [-eknptuvxJ [arg ...]]
-e	¥³¥Þ¥ó¥É¤¬°Û¾ï½ªÎ»¤·¤¿¾ì¹ç¤Ë¡¢Ä¾¤Á¤Ë½ªÎ»¡ÊExit¡Ë¤·¤Þ¤¹¡£
-k	¤¹¤Ù¤Æ¤Î¥­¡¼¥ï¡¼¥É°ú¿ô¤ò¡Ê¥³¥Þ¥ó¥ÉÌ¾¤ËÀè¹Ô¤¹¤ë¤â¤Î¤Ë¸Â¤é¤º¡Ë¡¢¥³¥Þ¥ó¥É¤Î´Ä¶­¤ËÃÖ¤¯¤è¤¦¤Ë¤·¤Þ¤¹¡£¡Ê¾Ü¤·¤¯¤Ï¡¢¾åµ­¤Î´Ä¶­¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ë
-n	¥³¥Þ¥ó¥É¤òÆÉ¤ß¼è¤ê¤Þ¤¹¤¬¡¢¼Â¹Ô¤·¤Þ¤»¤ó¡Êdo Not execute¡Ë¡£
-t	1¸Ä¤Î¥³¥Þ¥ó¥É¤òÆÉ¤ß¼è¤ê¡¢¼Â¹Ô¤·¤¿¸å¤Ç½ªÎ»¤·¤Þ¤¹¡£
-u	ÃÖ´¹»þ¤Ë¡¢¥»¥Ã¥È¤·¤Æ¤¤¤Ê¤¤ÊÑ¿ô¡ÊUnset variables¡Ë¤ò¥¨¥é¡¼°·¤¤¤Ë¤·¤Þ¤¹¡£    
-v	¥·¥§¥ë¤ÎÆþÎÏ¹Ô¤ò¡¢ÆÉ¤ß¼è¤ê»þ¤ËÉ½¼¨¤·¤Þ¤¹¡£
-x	¥³¥Þ¥ó¥É¤È¤½¤Î°ú¿ô¤ò¡¢¼Â¹Ô¤¹¤ë¡ÊeXecute¡Ë»þÅÀ¤ÇÉ½¼¨¤·¤Þ¤¹¡£
-J	csh¥¹¥¿¥¤¥ë¤Î¥¸¥ç¥ÖÀ©¸æµ¡Ç½¡ÊJob control¡Ë¤ò»ÈÍÑ²ÄÇ½¤Ë¤·¤Þ¤¹¡£
-	-x ¤ª¤è¤Ó -v ¥Õ¥é¥°¤ò¥ª¥Õ¤Ë¤·¤Þ¤¹¡£

¤³¤ì¤é¤Î¥Õ¥é¥°¤Ï¡¢¥·¥§¥ë¤Îµ¯Æ°»þ¤Ë¤â»ØÄê¤Ç¤­¤Þ¤¹¡£¸½ºß¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥é¥°¤Ï¡¢$- ¤Ç¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£

»Ä¤ê¤Î°ú¿ô¤Ï¡¢°ÌÃÖ¥Ñ¥é¥á¡¼¥¿¤Ë¤Ê¤ê¡¢½çÈÖ¤Ë¡¢ $1, $2, ... ¤Ë³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£°ú¿ô¤ò»ØÄê¤·¤Ê¤¤¤È¡¢¤¹¤Ù¤Æ¤ÎÌ¾Á°¡Êname¡Ë¤ÎÃÍ¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£

shift
°ÌÃÖ¥Ñ¥é¥á¡¼¥¿¤òº¸¤Ë¥·¥Õ¥È¤·¤Æ¡¢$2, ... ¤ò$1, ... ¤Î¤è¤¦¤Ë¥ê¥Í¡¼¥à¤·¤Þ¤¹¡£

times
¥·¥§¥ë¤«¤éµ¯Æ°¤µ¤ì¤¿¥×¥í¥»¥¹¤Ë´Ø¤¹¤ë¥æ¡¼¥¶»þ´Ö¤È¥·¥¹¥Æ¥à»þ´Ö¤ÎÎßÀÑÃÍ¤òÉ½¼¨¤·¤Þ¤¹¡£

trap [arg] [n] ...
¥·¥§¥ë¤¬¥·¥°¥Ê¥ë n, ...¤ò¼õ¤±¼è¤Ã¤¿»þÅÀ¤Ç¡¢arg ¤Ç»ØÄê¤µ¤ì¤ë¥³¥Þ¥ó¥É¤¬ÆÉ¤ß¼è¤é¤ì¡¢¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¡Êarg ¤Ï¡¢trap¥³¥Þ¥ó¥É¤¬¥»¥Ã¥È¤µ¤ì¤¿»þÅÀ¤Ç°ìÅÙ¥¹¥­¥ã¥ó¤µ¤ì¡¢trap¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤ë»þÅÀ¤Ç¤â¤¦°ìÅÙ¥¹¥­¥ã¥ó¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ëtrap¥³¥Þ¥ó¥É¤Ï¡¢¥·¥°¥Ê¥ë¤Î¿ô»ú½ç¤Ë¼Â¹Ô¤µ¤ì¤Þ¤¹¡£arg ¤¬»ØÄê¤µ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢trap n ¤Ç»ØÄê¤µ¤ì¤ë¤¹¤Ù¤Æ¤Î¥·¥°¥Ê¥ë n ¤¬¸µ¤ÎÃÍ¤ËºÆÀßÄê¤µ¤ì¤Þ¤¹¡£arg ¤¬¥Ì¥ëÊ¸»úÎó¤Î¾ì¹ç¤Ë¤Ï¡¢»ØÄê¤·¤¿¥·¥°¥Ê¥ë n, ...¤Ï¥·¥§¥ë¤ª¤è¤Óµ¯Æ°¤·¤¿¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤ÆÌµ»ë¤µ¤ì¤Þ¤¹¡£n ¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¡¢¥³¥Þ¥ó¥Éarg¤Ï¡¢¥·¥§¥ë¤Î½ªÎ»»þ¤Ë¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢sigvec(2)¤ËËçµó¤µ¤ì¤Æ¤¤¤ë¥·¥°¥Ê¥ë n ¤¬¼õ¿®¤µ¤ì¤Þ¤¹¡£°ú¿ô¤ò»ØÄê¤·¤Ê¤¤trap¤Ï¡¢³Æ¥·¥°¥Ê¥ë¤Î¿ô»ú¤ËÂÐ±þ¤¹¤ë¥³¥Þ¥ó¥É¤Î¥ê¥¹¥È¤òÉ½¼¨¤·¤Þ¤¹¡£

umask [ nnn ]
¥æ¡¼¥¶¥Õ¥¡¥¤¥ëºîÀ®¥Þ¥¹¥¯¤¬¡¢8¿Ê¿ônnn¤Ë¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£¡Ê¾Ü¤·¤¯¤Ï¡¢umask(2)¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ënnn¤ò¾ÊÎ¬¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î»þÅÀ¤Î¥Þ¥¹¥¯¤ÎÃÍ¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£

wait [n]
n¤Ç»ØÄê¤µ¤ì¤ë¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤Î¤òÂÔ¤Á¡Êwait¡Ë¡¢¤½¤Î¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤òÄÌÃÎ¤·¤Þ¤¹¡£n¤ò»ØÄê¤·¤Ê¤¤¾ì¹ç¤Ï¡¢¤½¤Î»þÅÀ¤Ç¥¢¥¯¥Æ¥£¥Ö¤Ê»Ò¥×¥í¥»¥¹¤Î¤¹¤Ù¤Æ¤ËÂÐ¤·¤Æ¡¢½ªÎ»¤¹¤ë¤Î¤òÂÔ¤Á¤Þ¤¹¡£wait¥³¥Þ¥ó¥É¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É¤Ï¡¢»ØÄê¤·¤¿¥×¥í¥»¥¹¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ë¤Ê¤ê¤Þ¤¹¡£

¡Îµ¯Æ°¡Êinvocation¡Ë¡Ï
0ÈÖÌÜ¤Î°ú¿ô¤ÎºÇ½é¤ÎÊ¸»ú¤¬ - ¤Î¾ì¹ç¡¢¥³¥Þ¥ó¥É¤Ï¡¢$HOME/.profile¤«¤éÆÉ¤ß¼è¤é¤ì¤Þ¤¹¡£¡Ê¤¿¤À¤·¡¢$HOME/.profile¤¬Â¸ºß¤¹¤ë¾ì¹ç¡£¡Ë¤½¤Î¸å¡¢¥³¥Þ¥ó¥É¤Ï°Ê²¼¤Ë½Ò¤Ù¤ë¤è¤¦¤Ë¤·¤ÆÆÉ¤ß¼è¤é¤ì¤Þ¤¹¡£°Ê²¼¤Î¥Õ¥é¥°¤Ï¡¢¥·¥§¥ë¤Îµ¯Æ°»þ¤Ë¡¢¥·¥§¥ë¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤Þ¤¹¡£

-c string
-c¥Õ¥é¥°¤¬¤¢¤ë¾ì¹ç¡¢¥³¥Þ¥ó¥É¤Ïstring¤«¤éÆÉ¤ß¼è¤é¤ì¤Þ¤¹¡£

-s	
-s¥Õ¥é¥°¤¬¤¢¤ë¾ì¹ç¤Þ¤¿¤Ï»Ä¤ê¤Î°ú¿ô¤¬¤Ê¤¤¾ì¹ç¡¢¥³¥Þ¥ó¥É¤ÏÉ¸½àÆþÎÏ¡Êstandard input¡Ë¤«¤éÆÉ¤ß¼è¤é¤ì¤Þ¤¹¡£¥·¥§¥ë¤«¤é¤Î½ÐÎÏ¤Ï¡¢¥Õ¥¡¥¤¥ëµ­½Ò»Ò2¤Ë½ñ¤­¹þ¤Þ¤ì¤Þ¤¹¡£

-i	
-i¥Õ¥é¥°¤¬¤¢¤ë¾ì¹ç¡¢¤Þ¤¿¤Ï¥·¥§¥ë¤ÎÆþÎÏ¤È½ÐÎÏ¤¬Ã¼Ëö¤ËÀÜÂ³¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥·¥§¥ë¤ÏÂÐÏÃ·¿¡Êinteractive¡Ë¤È¤Ê¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢½ªÎ»¥·¥°¥Ê¥ëSIGTERM¡Êsigvec(2)»²¾È¡Ë¤ÏÌµ»ë¤µ¤ì¡Ê¤·¤¿¤¬¤Ã¤Æ¡¢'kill 0' ¤ÏÂÐÏÃ·¿¥·¥§¥ë¤ò½ªÎ»¤µ¤»¤Þ¤»¤ó¡Ë¡¢³ä¤ê¹þ¤ß¥·¥°¥Ê¥ëSIGINT¤Ï¡¢Êá³Í¤µ¤ì¤ÆÌµ»ë¤µ¤ì¤Þ¤¹¡£¡Ê¤·¤¿¤¬¤Ã¤Æ¡¢wait¤Ï³ä¤ê¹þ¤ß²ÄÇ½¤Ë¤Ê¤ê¤Þ¤¹¡£¡Ë¤É¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤â¡¢¥·¥°¥Ê¥ëSIGQUIT¤Ï¥·¥§¥ë¤Ë¤è¤Ã¤ÆÌµ»ë¤µ¤ì¤Þ¤¹¡£

-r	
-r¥Õ¥é¥°¤¬¤¢¤ë¾ì¹ç¡¢¥·¥§¥ë¤Ï¸ÂÄê¥·¥§¥ë¡Êrestricted shell¡Ë¤Ë¤Ê¤ê¤Þ¤¹¡£

»Ä¤ê¤Î¥Õ¥é¥°¤ª¤è¤Ó°ú¿ô¤Ï¡¢set¥³¥Þ¥ó¥É¤ÇÀâÌÀ¤·¤Æ¤¢¤ê¤Þ¤¹¡£

¡ÎÆüËÜ¸ìµ¡Ç½¡Ï
sh¤Ï¡¢EUC ¤Î¥Þ¥ë¥Á¥Ð¥¤¥È¥­¥ã¥é¥¯¥¿¤ò½èÍý¤Ç¤­¤Þ¤¹¡£¤¹¤Ù¤Æ¤Î½èÍý¤Ï¡¢¥Ð¥¤¥ÈÃ±°Ì¤Ç¤Ï¤Ê¤¯Ê¸»úÃ±°Ì¤Ç¤ª¤³¤Ê¤ï¤ì¤Þ¤¹¡£¤¿¤À¤·¡¢EUC ¤Î¥Þ¥ë¥Á¥Ð¥¤¥È¥­¥ã¥é¥¯¥¿¤ËÂÐ¤·¤Æ¡¢backspace½èÍý¤òÊ¸»úÃ±°Ì¤Ë¤ª¤³¤Ê¤¦¤¿¤á¤Ë¤Ï¡¢stty(1)¤Îeucbksp¥ª¥×¥·¥ç¥ó¤ò»ØÄê¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£

[ ] ¤òÍÑ¤¤¤Æ¡¢ÈÏ°Ï»ØÄê¤ò¤ª¤³¤Ê¤¦¾ì¹ç¡¢°Û¤Ê¤ë¥³¡¼¥É¥»¥Ã¥È¤Ë¤Þ¤¿¤¬¤ëÈÏ°Ï¤ò»ØÄê¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
°Û¤Ê¤ë¥³¡¼¥É¥»¥Ã¥È¤Ë¤Þ¤¿¤¬¤ëÈÏ°Ï¤ò»ØÄê¤·¤¿¾ì¹ç¡¢ÈÏ°Ï¤ò»ØÄê¤¹¤ëºÇ½é¤ÈºÇ¸å¤ÎÊ¸»ú¤Ë¤Î¤ß°ìÃ×¤·¤Þ¤¹¡£
Îã¤¨¤Ð¡¢[a-°¡] ¤Ï¡¢[a°¡] ¤ÈÆ±°ì»ë¤µ¤ì¤Æ¡¢`a' ¤Þ¤¿¤Ï `°¡' ¤È°ìÃ×¤·¤Þ¤¹¡£

¡Î¥Õ¥¡¥¤¥ë¡Ï
/etc/profile.std
$HOME/.profile
/tmp/sh*
/dev/null

¡Î´ØÏ¢¹àÌÜ¡Ï
csh(1), echo(1), login(1), test(1), ps(1), pwd(1), stty(1), dup(2), execve(2), fork(2), getpid(2), getuid(2), sigvec(2), Mach-O(5), environ(7)

¡Î¿ÇÃÇ¡Ï
¡Ê¹½Ê¸¥¨¥é¡¼¤Î¤è¤¦¤Ë¡Ë¡¢¥·¥§¥ë¤Ë¤è¤Ã¤Æ¸¡ÃÎ¤µ¤ì¤ë¥¨¥é¡¼¤Ï¡¢¥·¥§¥ë¤ò0°Ê³°¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤Ç½ªÎ»¤µ¤»¤Þ¤¹¡£¥·¥§¥ë¤¬ÈóÂÐÏÃ·¿¡Ênon interactive¡Ë¤Ç»ÈÍÑ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥·¥§¥ë¥Õ¥¡¥¤¥ë¤Î¼Â¹Ô¤¬Êü´þ¤µ¤ì¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢¥·¥§¥ë¤Ï¡¢ºÇ¸å¤Ë¼Â¹Ô¤·¤¿¥³¥Þ¥ó¥É¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤·¤Þ¤¹¡£¡Êexit¤Î¹à¤â»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ë

¡ÎÃí°Õ»ö¹à¡Ï
&¤Ë¤è¤Ã¤Æµ¯Æ°¤µ¤ì¤¿ÈóÆ±´ü¥×¥í¥»¥¹¡Êasynchronous process¡Ë¤ËÂÐ¤·¤Æ¡¢<<¤ò»ÈÍÑ¤·¤ÆÉ¸½àÆþÎÏ¤òÍ¿¤¨¤ë¤È¡¢¥·¥§¥ë¤ÏÆþÎÏ¥É¥­¥å¥á¥ó¥È¤ÎÌ¿Ì¾¤òº®Æ±¤·¤Þ¤¹¡£¥¬¡¼¥Ù¥Ã¥¸¥Õ¥¡¥¤¥ë/tmp/sh*¤¬ºîÀ®¤µ¤ì¡¢¥·¥§¥ë¤ÏÊÌ¤ÎÌ¾Á°¡Êname¡Ë¤Ç¥Õ¥¡¥¤¥ë¤ò¸«¤Ä¤±¤é¤ì¤Ê¤¤¤È¤¤¤¦·Ù¹ð¤òÈ¯¤·¤Þ¤¹¡£