Yes, you also need to use `local` on loop control variables

Leo Gutiérrez
2 min readJun 6, 2021
BASH

Hi there! this will be a quick-short blog post about Bash, specifically about one of the coolest bash builtins, local.

I wanted to clarify a few things about this shell builting that, I feel most of the Bash developers don´t pay attention to, they seem to ignore control variables from the equation and only use the builtin with explicit variables. I saw two cases…

--

--

Leo Gutiérrez

Hi! I am Leonardo Gutiérrez R., a passionate software developer, I hope you find the content in this blog interesting. I write about IT related stuff.