[TUHS] A few comments on porting the Bourne shell

Steve Nickolas usotsuki at buric.co
Sat Dec 31 14:12:11 AEST 2022


On Fri, 30 Dec 2022, Larry McVoy wrote:

> When I was running my engineering team I was strict about Bourne syntax
> and features only.  I got pushed on like crazy because "bash has this
> $GOODNESS whhhhhhhy can't we use it".  Because we were supporting our
> product on pretty much every unix and if it wasn't HP-UX that had an
> ancient /bin/sh, it was AIX or whoever.
>
> Over and over, I won the "straight bourne shell only" battle.  So I agree,
> if you want /bin/sh to work, Bourne shell for the win.
>
> For a login shell, bash is my shell of choice.  It's bloated but I'm
> typing this on a 5 year old Lenova X1 Carbon with 16GB of memory and
> 4 cores and it's fine.  It was fine a 133mhz Pentium.

There's some variants of the Almquist shell that have bash-style 
command-line editing, and I can deal with that if that's /bin/sh.  Usually 
I use bash and it's plenty fine.

I generally code shell scripts for Posix sh as my baseline and start my 
scripts with #!/bin/sh - but sometimes I'll use #!/bin/ksh if I don't 
expect them to be used on another machine.  ksh93 is lighter and faster 
than bash and the only things I miss are quirks of the command line 
editor.

-uso.


More information about the TUHS mailing list