lintsh is a Bourne shell that optionally warns about suspicious or nonportable constructs. It is intended to help script authors write correct, portable scripts; it will also be suitable for use as /bin/sh. It does not exist yet, and it might never, or perhaps the warning functionality could be added to an existing shell. Regardless, this list of gotchas will be maintained, and you can get into the habit of coding to avoid them.

The following programs are known to be in use as /bin/sh, in addition to the /bin/sh programs maintained by OS vendors. Please let me know about any not listed here.

You can also contribute by emailing me suggestions for constructs to warn about. My experience is mostly with bash and pdksh, so information about issues with other shells is especially appreciated. I am not interested in how shells behave in interactive mode; scripts are only affected by differences in behavior in noninteractive mode. Here's the list of issues so far. (Some are bugs in particular versions; these will still be warned about as long as buggy installations are thought to be common, or as long as I forget to update this page.)

Related Links

Constructs likely to indicate a programming error

Constructs meaningful to all shells, but with different meanings to different shells

Constructs not meaningful to some shells

These will also be erroneous for lintsh; no separate warning will be necessary. These include: