2004/11/28(Æü) [nǯÁ°¤ÎÆüµ]
#7 [linux] _¥·¥§¥ë¥¹¥¯¥ê¥×¥È ¥ê¥Õ¥¡¥ì¥ó¥¹ & Tips
ls *.ppm ¤Ç hoge01.ppm ¡Á hoge60.ppm ¤¬É½¼¨¤µ¤ì¤ë¤È¤·¤Æ¡£hoge01.pm hoge02.ppm ¡Á hoge60.ppm ¤ÈÎóµó¤·¤¿¤¤¤Î¤À¤±¤É¡£¤É¤¦¤¹¤ê¤ã¤¨¤¨¤Î¤ä¤í¡£
¡ý ¤³¤ó¤Ê´¶¤¸¤«¤·¤é :
#!/bin/sh for file in $(ls *.ppm) do echo -n "$file " done¤â¤Ã¤È¾å¼ê¤¤ÊýË¡¤¬¤¢¤ê¤½¤¦¤Êµ¤¤â¤¹¤ë¤Î¤À¤±¤É¡£¤¦¡¼¤ó¡£
¡ý 2004/12/01Äɵ¡§echo¤Ç¥µ¥¯¥Ã¤È¤Ç¤¤ë¤³¤È¤ò¶µ¤¨¤Æ¤â¤é¤Ã¤¿¤Î¤Ç¤¢¤ê¤Þ¤¹ :
echo *.ppm¤À¤±¤ÇOK¤À¤Ã¤¿¤È¤Ï¡ª ´¶Æ°¡£»ØŦ¤¢¤ê¤¬¤¿¤ä¡Ä (¡¢¦¡®)
¤³¤Îµ»ö¤Ø¤Î¥Ä¥Ã¥³¥ß
[ ¥Ä¥Ã¥³¥ß¤òÆɤà(4) | ¥Ä¥Ã¥³¤à ]
°Ê¾å¤Ç¤¹¡£
ô(¡±¢¢¡±;)¡ª¡ª
½Ð¤Þ¤·¤¿¡ª ¥Ð¥Ã¥Á¥ê¤Ç¤¹¡ª
¤¦¤ï¡Ä¤³¤ó¤Ê¤Ë´Êñ¤Ë½ÐÍ褿¤Î¤«¡Ä¡£¥¹¥´¥¤¡ª echo¤Ã¤Æ¡¢¥¹¥´¥¤¡ª
thx¤Ç¤¢¤ê¤Þ¤¹¡£´¶¼Õ´¶·ã¤Ç¤¢¤ê¤Þ¤¹¡£
¤½¤¦¤«¡¢¤³¤ó¤Ê¼ê¤¬¤¢¤Ã¤¿¤Î¤«¡£¤Ê¤ë¤Û¤É¡Ä
¤¢¤Èfor file in $(ls *.ppm) ¤Ï for file in *.ppm ¤ÎÊý¤¬¤¤¤¤¤Ç¤¹¡£¥¿¥¤¥×¿ô¾¯¤Ê¤¤¤·ls¥³¥Þ¥ó¥É¤òµ¯Æ°¤¹¤ëɬÍפâ¤Ê¤¤¤Î¤Ç¡£
¥·¥§¥ë¤ÎÀâÌÀ¤Ï¤¤¤Þ¥°¥°¥Ã¤¿¤é
http://flex.ee.uec.ac.jp/texi/sh/node5.html#SECTION00032000000000000000
¤¬¤¤¤¤´¶¤¸¡£
¤Ê¤ë¤Û¤É¡£¤½¤¦¤¤¤¦¤ï¤±¤Ç¤·¤¿¤«¡£ÊÙ¶¯¤Ë¤Ê¤ê¤Þ¤¹¤Ç¤¹¡£¦Õ(..)¥á¥â¥á¥â
> ¥·¥§¥ë¤ÎÀâÌÀ¥Ú¡¼¥¸
¤ª¤ª¡ª ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡ª
¤¿¤·¤«¤Ë¤³¤Î¥Ú¡¼¥¸¡¢È½¤ê¤ä¤¹¤¤¡Ä
¾¤Î¥Ú¡¼¥¸¤âÊÙ¶¯¤Ë¤Ê¤ëÆâÍƤФ«¤ê¤Ç¤¹¤Ê¡£´¶¼Õ¤Ç¤¢¤ê¤Þ¤¹ (¡¢¦¡®)