{"provider_name":"Hatena Blog","height":"190","provider_url":"https://hatena.blog","published":"2011-07-02 14:43:38","blog_url":"https://uehaj.hatenablog.com/","title":" [groovy][groovy1.9] begin\u3001end\u30e1\u30bd\u30c3\u30c9\u306f\u7279\u5225\u6271\u3044","author_url":"https://blog.hatena.ne.jp/uehaj/","description":"Groovy 1.9 SNAPSHOT*1\u3067\u306f\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u5b9a\u7fa9\u3057\u305fbegin,end\u30e1\u30bd\u30c3\u30c9\u306f\u3001-p,-n\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066\u5b9f\u884c\u3055\u308c\u308b\u3068\u304d\u3001\u7279\u5225\u6271\u3044\u3055\u308c\u307e\u3059\u3002\u3064\u307e\u308a\u305f\u3068\u3048\u3070\u3001beginendtest.groovy: def begin(){ total = 0 } total += line.split(\" +\")[4] as int def end(){ println total } \u3068\u3044\u3046\u30b3\u30fc\u30c9\u3092\u7528\u610f\u3057\u3066\u304a\u304f\u3068\u3001\u3053\u308c\u306f\u7b2c\u4e94\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5408\u8a08\u3059\u308b\u3082\u306e\u3067\u3059\u304c\u3001 $ ls -l | grep -v '^total' | /tool/groovy-1.9-trunk/groovy-core/ta\u2026","url":"https://uehaj.hatenablog.com/entry/20110702/1309585418","image_url":null,"author_name":"uehaj","width":"100%","version":"1.0","blog_title":"uehaj's blog ","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fuehaj.hatenablog.com%2Fentry%2F20110702%2F1309585418\" title=\" [groovy][groovy1.9] begin\u3001end\u30e1\u30bd\u30c3\u30c9\u306f\u7279\u5225\u6271\u3044 - uehaj&#39;s blog \" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":[]}