[TUHS] A few comments on porting the Bourne shell

John Cowan cowan at ccil.org
Wed Jan 4 13:20:46 AEST 2023


On Mon, Jan 2, 2023 at 12:43 PM Larry McVoy <lm at mcvoy.com> wrote:


> I was supporting a commercial product in the early 2000's and there
> were all sorts of systems then that had old shells.  Yes, you could make
> everything a 2 level thing where the first level finds the correct shell,
> but that's just fuss.  Just make things portable, it's not that hard
> and it works everywhere.
>

Making shell scripts portable means not using pipelines, because given "foo
| bar", kshNN and zsh execute foo in a subshell and bar in the top-level
shell, whereas in other shells, both foo and bar execute in subshells.
(For this reason, Posix allows either behavior.)  Not having pipelines is a
pretty drastic limitation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20230103/bc27c54e/attachment.htm>


More information about the TUHS mailing list