Weird behaviour when bash function has the Unicode name
Author: giappiCreated Dec 30, 2021Updated Sep 24, 2026
For bugs
- Rule Id (if any, e.g. SC1000): SC1036, SC1088
- My shellcheck version (
shellcheck --versionor 'online'): online - I tried on shellcheck.net and verified that this is still a problem on the latest commit
- It's not reproducible on shellcheck.net, but I think that's because it's an OS, configuration or encoding issue
For new checks and feature suggestions
- shellcheck.net (i.e. the latest commit) currently gives no useful warnings about this
- I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related
Here's a snippet or screenshot that shows the problem:
#!/bin/bash
function ■()
{
echo "■ $@"
}
Here's what shellcheck currently says:
Line 3 SC1036: '(' is invalid here. Did you forget to escape it?
Line 3 SC1088: Parsing stopped here. Invalid use of parentheses?Here's what I wanted or expected to see:
Unicode is valid bash function name. In case of it does not support Unicode, I think it should show the error message like "invalid function name".
Source: koalaman/shellcheck