Catch undefined commands / functions
Author: functiconsCreated Sep 14, 2022Updated Sep 22, 2026
For new checks and feature suggestions
- https://www.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
Is it possible to generate warning for undefined command / function? The use case is to catch typos. In practice, I'm okay to maintain a dictionary of command / function names.
Here's a snippet or screenshot that shows the problem:
#!/bin/bash
echa "hello world"
Here's what shellcheck currently says:
No issues detected!
Here's what I wanted or expected to see:
Unknown command "echa"
Source: koalaman/shellcheck