Once upon a time I was writing a few portable shell scripts for Solaris and Linux distros. Limiting the scripts to a common subset of commands was fighting windmills - so often you stuck with something easily solved by one GNU option, but requiring 10+ lines of shell script with UNIXy commands on Solaris.
In the end, it was much easier to just proclaim GNU coreutils as a dependency everywhere, and use g-prefixed versions of commands (gfind, ggrep, and so on).