>> So my patch additionally includes a replacement of those two >> statements with ${var##pattern} and ${var%pattern} expansions. These >> expansions are POSIX and should thus be reasonably portable. Sorry, POSIX introduced many incompatible shell constructs (and command line options, and ...) that must be avoided for anything that actually needs to be portable.