å®é¨ã®ã¾ã¨ãã åç½®ã bash ã§ã¯ç¹ã«æå®ããªãéãã å¤æ°ã¯å¸¸ã«ã°ãã¼ãã« ãªå¤æ°ã¨ãã¦æ±ããã¦ãã¾ãã¾ãã #!/bin/bash function foo() { hoge="foo" } foo echo $hoge # foo ã¨åºåããã å¤æ°ãã¤ãããã³ã«ãã°ãã¼ãã«ãªé åãæ±æãã¦ããã®ã¯ãããããªãã®ã§ãããã§ã¯ã°ãã¼ãã«åã®å¯¾çã¨ã㦠bash ã®ãã«ãã¤ã³ã³ãã³ã local ã使ç¨ãã¾ãã #!/bin/bash function foo() { local hoge="foo" } foo echo $hoge # 空åºå ãã®ããã«ãæ示çã« local ã®å¤æ°ã ãã¼ã£ã¦å®£è¨ãã¦ãããã¨ãé¢æ°ãã§ãã¨ãã«ã¯å¿ããããªãã ãéãªæ°ããã¾ãã...ã æ¬é¡ bash ã§ã¯ for ã«ã¼ãã«ä½¿ç¨ããå¤æ° ããread ã§åãåãå¤æ° ãä»ã®å¤æ°ã¨åæ§ã«ãç¹ã«æå®ã
{{#tags}}- {{label}}
{{/tags}}