{"title":"Bash if\u6587\u3068for\u6587\u306e\u6d3b\u7528\u4f8b5\u3064\u3002\u307b\u307c\u30b3\u30d4\u30da\u3067\u5229\u7528\u53ef\u80fd","published":"2018-05-09 23:49:02","url":"https://hk29.hatenablog.jp/entry/2018/05/09/234902","blog_title":"Python\u3068VBA\u3067\u4e16\u306e\u4e2d\u3092\u4fbf\u5229\u306b\u3059\u308b","categories":["Shell","Linux"],"description":"'20/09/21\u66f4\u65b0\uff1a \u672c\u8a18\u4e8b\u3067\u306f\u3001Linux\u306eshell(\u30b7\u30a7\u30eb)\u306e\u3072\u3068\u3064\u3067\u3042\u308bBash(\u30d0\u30c3\u30b7\u30e5)\u306b\u3064\u3044\u3066\u3001\u666e\u6bb5\u3088\u304f\u4f7f\u7528\u3059\u308bif\u65873\u3064\u3001for\u65872\u3064\u306e\u8a085\u3064\u306e\u96db\u5f62\u30b3\u30fc\u30c9\u3092\u8a18\u8f09\u3057\u307e\u3057\u305f\u3002 if\u6587 1. \u6570\u5024\u3067\u5224\u5b9a\u3057\u3066\u6761\u4ef6\u5206\u5c90\u3059\u308b \u6b21\u306e\u4f8b\u3067\u306f\u3001x\u304c\u5076\u6570\u306e\u5834\u5408\u306bx+1\u3092set_num\u306b\u4ee3\u5165\u3057\u3001x\u304c\u5947\u6570\u306e\u5834\u5408\u306fx-1\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002 #!/bin/sh x=$((101)) echo $x val=$((($x)%2)) if [ $val -eq 0 ]; then set_num=$(($x+1)) else set_num=$(($x-1)) fi echo $set_num 2. \u6587\u5b57\u5217\u3067\u2026","author_name":"HK29","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhk29.hatenablog.jp%2Fentry%2F2018%2F05%2F09%2F234902\" title=\"Bash if\u6587\u3068for\u6587\u306e\u6d3b\u7528\u4f8b5\u3064\u3002\u307b\u307c\u30b3\u30d4\u30da\u3067\u5229\u7528\u53ef\u80fd - Python\u3068VBA\u3067\u4e16\u306e\u4e2d\u3092\u4fbf\u5229\u306b\u3059\u308b\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","provider_url":"https://hatena.blog","image_url":null,"version":"1.0","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/HK29/","blog_url":"https://hk29.hatenablog.jp/","width":"100%"}