Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 463 Bytes

SC3043.md

File metadata and controls

29 lines (20 loc) · 463 Bytes

Pattern: Use of undefined local flag

Issue: -

Description

local is supported in many shells, including bash, ksh, dash, and BusyBox ash. However, strictly speaking, it's not POSIX.

Example of incorrect code:

myfunc() {
  local i=0
  ..
}

Example of correct code:

myfunc() {
  _myfunc_i=0
  ..
}

Further Reading