Question: What resources exist for portable shell programming? The ultimate answer is to test on all targeted platforms, but that's rarely practical.

The [POSIX / Single UNIX specification](http://pubs.opengroup.org/onlinepubs/009695399/) is a start, but it tells neither you what the level of support of each implementation is, nor what common extensions exist. You can read the documentation of each implementation, but that's very time consuming and not completely accurate.

I seems to me that an ideal format would be some kind of community-annotated version of the POSIX spec, where each feature is annotated by its support level amongst the different implementations. Is there such a thing? Or are there other useful resources?

For example, there is [Sven Mascheck's shell portability pages](http://www.in-ulm.de/~mascheck/various/), but it's only about syntactic elements and a few built-ins, and only covers old shells. I'm looking for a more comprehensive resource.

Answer: 
In addition to `dash` and `posh`, there's `bournesh` (or `bsh`), the [Heirloom Bourne Shell](http://freshmeat.net/projects/bournesh/), that can be used to detect [Bashisms](http://mywiki.wooledge.org/Bashism).

The Heirloom Project also includes "The Heirloom Toolchest", a collection of more than 100 standard Unix utilities (which could serve as a starting point for comparing command line options).
To a little extent, you can try [`checkbashisms`](http://wiki.ubuntu.com/DashAsBinSh) in Debian/Ubuntu's `devscripts` package.

It is not perfect, but it has the benefit of being an existing starting point. For example, it doesn't see the classical glitches with `sed`/`find` concerning the GNU vs BSD/other differences.

By default, it is Debian+`dash` oriented; the `-p` flag can be useful for your case.