urls.txtã«ã¯ã1è¡ã«ä¸ã¤ã®URLãè¨è¿°ããã¦ããã¨ãã¾ããããããã¢ã³ã«ã¼ã®ãªã¹ãã§ããHTMLã«å¤æãããã¨æã£ãã®ã§ãããªããã¹ã¯ãªããè¨èªã使ãããã¨ãæã£ãã®ã§ãããprintfã³ãã³ããããããã·ã§ã«ã®ã¯ã³ã©ã¤ãã¼ã§ãããã ããã¨ã
$ (echo '<ol>'; cat urls.txt | while read url; do printf "<li><a href=\"%s\">%s</a></li>\n" $url $url; done; echo '</ol>') > tmp.html
readã³ãã³ã§1è¡ãã¤èªãã§ããããprintfã³ãã³ãã«æ¸¡ããã ãã§ããã¯ã³ã©ã¤ãã¼ã§ã¯è¦ã¥ããã§ãããããæ¹è¡ãå ¥ãã¦æ´å½¢ããã°ï¼
#!/bin/sh echo '<ol>' cat urls.txt | while read url do printf "<li><a href=\"%s\">%s</a></li>\n" $url $url done echo '</ol>'