local is undefined in ksh93, but not flagged.
Author: slycordinatorCreated Jul 25, 2025Updated Sep 26, 2026
For bugs with existing features
- Related to Rule SC3043
- My shellcheck version: Online
- The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
- I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit
In the Wiki for SC3043, it states that local is supported in ksh, but this is not true of ksh93.
Here's a snippet or screenshot that shows the problem:
#!/bin/ksh93
my_function() {
local local_var="$1"
echo "${local_var}"
}
my_function some_stringHere's what shellcheck currently says:
No issues detected!
Here's what I wanted or expected to see:
local is undefined in ksh93
Output from the shell
ksh93: my_function[2]: local: not found
Source: koalaman/shellcheck