DEV Community

Aubrey Portwood
Aubrey Portwood

Posted on • Edited on

Need to use shellcheck with .zsh and or #!/bin/zsh scripts? [SC1071]

If, like me, you find yourself trying to use shellcheck to lint .zsh files with #!/bin/zsh but it keeps telling you:

A screenshot of the error below.



shellcheck: error
error - ShellCheck only supports sh/bash/dash/ksh scripts. 
Sorry! [SC1071]


Enter fullscreen mode Exit fullscreen mode

What I was able to do is pass the --shell=bash argument to shellcheck and then it would lint my files.

In my case this was configured in my SublimeLinter config, like so:



{
    "linters": {
        "shellcheck": {
            "args": [
                "--shell=bash"
            ]
        },
    }
}


Enter fullscreen mode Exit fullscreen mode

...just in case you are using Sublime Text!

Top comments (0)