{"title":"Bash\u3067Project Euler\uff084\uff09 \u95a2\u6570","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20170509%2Fp1\" title=\"Bash\u3067Project Euler\uff084\uff09 \u95a2\u6570 - inamori\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/inamori/","published":"2017-05-09 00:00:00","author_name":"inamori","type":"rich","provider_name":"Hatena Blog","width":"100%","height":"190","version":"1.0","url":"https://inamori.hateblo.jp/entry/20170509/p1","image_url":null,"blog_url":"https://inamori.hateblo.jp/","categories":["Bash"],"description":"\u95a2\u6570f\u306f\u6b21\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3057\u307e\u3059\u3002 [function] f() { ... } \u95a2\u6570\u306e\u5024\u306e\u8fd4\u3057\u65b9\u306b\u306f2\u7a2e\u985e\u3042\u308a\u307e\u3059\u3002 is_even() { n=$1 return $((n%2)) } \u5f15\u6570\u306f\u3001$1\u3001$2\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002\u305d\u3057\u3066\u3001return\u3067\u8fd4\u3057\u307e\u3059\u3002 \u8fd4\u305b\u308b\u5024\u306f0\u301c255\u306e\u6574\u6570\u306b\u9650\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u4e0a\u306e\u3088\u3046\u306b\u3001\u53d9\u8ff0\u95a2\u6570\u304f\u3089\u3044\u3057\u304b\u4f7f\u3044\u9053\u304c\u5206\u304b\u308a\u307e\u305b\u3093\u3002\u6b21\u306f\u3001\u5076\u6570\u306e\u307f\u6a19\u6e96\u51fa\u529b\u3057\u307e\u3059\u3002 #!/bin/bash is_even() { n=$1 return $((n%2)) } for n in `seq 1 10`; do if is_even $n; then echo $n fi done \u3082\u2026","provider_url":"https://hatena.blog","blog_title":"inamori\u2019s diary"}