1. 16

(Here’s a link to the sourcehut project.)


  2. 4

    My understanding is that the POSIX shell spec isn’t nearly detailed enough to define a complete shell, so the promise of “if it runs on mrsh, it’s portable” seems dubious.

    1. 10

      IMO to be strictly POSIX compliant, you’d have to randomly choose between ambiguous interpretations so that you can’t rely on a specific behavior.

      1. 2

        This would be wonderfully chaotic! I can imagine the docs now:

        Feature foo does either thing x or, if you’re unlucky, another slightly different thing y.

        1. 4

          It is not like this hasn’t ever been done before.

          1. 1

            Wow that’s simultaneously hilarious and disturbing. I suppose it gets the point across…

      2. 6

        My understanding (I could very well be wrong!) is that POSIX sh is the “minimum bar” of a shell – it’s quite usable by itself (as long as you don’t need fancy features like, gosh, arrays), and every modern shell strives to be compatible with it. In my experience, anything that’s POSIX-sh-compliant will run properly on dash, bash, mksh, etc.

        1. 4

          I think that’s more of the result of these shells being tested against each other.

          1. 4

            In practice I find that the biggest problem is compatibility of shell utilities, rather than the shell itself. The POSIX shell utilities are really bare-bones (and some are outright missing, like stat) and it can be rather tricky to do things sticking to just the POSIX flags. It’s really easy for various extensions to sneak in even when you intend to write a fully compatible script (and arguably, often that’s okay too, depending on what you’re doing and who the intended audience is).

            I appreciate that POSIX is intended as a “minimum bar” kind of specification, but sometimes I wish it would be just a little less conservative.

          2. 2

            Strong https://xkcd.com/1312/ vibes

          3. 2

            I remember in the old days HP-UX had a /bin/posix/sh - maybe its documentation (if you can find old manuals) can help for the definition and test cases also.

            1. 2

              I guess this is something like Debian’s posh?

              1. 5

                posh still has more features than POSIX requires, that mrsh doesn’t have, like arrays.

              2. 1

                imrsh based on mrsh might be something interesting in the future. It seems to be an attempt at replicating unmatched Fish interactive usage UX (zsh is not even close and bash’s UX is a joke) but in POSIX shell. I’d love to use something like that.