Hacker News new | ask | show | jobs
by honkcity 73 days ago
Is there a linter to ensure scripts are portable across shells? I try to write them like that but I'm certainly no master so I write them to work with busybox.
2 comments

A linter, not yet.

You can use what I use: https://github.com/alganet/shell-versions

It's a container with lots of shells that you can test. Like esvu but for the shell.

Might have a little outdated docs, hit me with an issue if you use it and face any problems (I'm also the author).

I think shellcheck helps quite a lot, you must set type to "sh" (not bash) somewhere in the comments though...