🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #230

Re: Back To CS Basics. Fuck AI

#230
From: Janis Papanagnou
Date: Sat, 24 Oct 2026 09:53
73 lines
4532 bytes
On 2026-10-24 05:59, c186282 wrote:
> 
>    KSH and BASH are "mostly compatible". Minor diffs but
>    nothing hard to get around. Anything you can do in KSH
>    can be done in BASH.

This is not correct. While Bash has over time adopted quite
some features from Ksh - but sadly needed often far too many
years for that - there's still a lot substantial functions
in Ksh that Bash has not implemented (or substituted by some
equivalent feature).

> [...]
> 
>    If KSH works for you then stick with it.

I use Ksh meanwhile for ~35 years, and since I use a lot of
Ksh features that Bash just doesn't support there's certainly
no reason to switch. (Also its speed is a criterion, BTW. And
back then there were no Bash versions on commercial Unixes;
but commercial Linuxes haven't the prevalence any more today,
and play no role now in my private systems context.)

>    Note however that MOST distros default to BASH now -

Yes, Linux often has Bash as its default.

>    so if you plan
>    to 'distribute' your work it'd be better to move your
>    stuff over to BASH.

Certainly not.

And this is short-sighted. If _portability_ is an issue you'd
better stick with the POSIX subset of both, Ksh and Bash.

(Sadly, as we observe, especially "Linux kiddies" often don't
know what that POSIX subset actually is; in their scripts they
are writing #!/bin/sh and using some bash-specific syntax not
realizing that there's a difference, and that Bash is not the
[portable] *standard*.)

>    Most distros, users would have to
>    intentionally install KSH and scripts would need a
>    shebang at the top to specify which shell to use.

I don't recall to have ever "intentionally installed" Ksh on
Linux. Earlier Linuxes had just a (sub-optimal!) PD-ksh that
you could use out of the box. Later they provided also the
much better "original" [AT&T] Ksh, and meanwhile you find on
(some?) Linuxes ksh93u+m, Martijn Dekker's improved version.

Of course you can call shell scripts with the executable-flag
set and with a she-bang line on top. Personally I run most
shell scripts with the interpreter explicitly provided, as in
   ksh my-script flags arguments
allowing easy debugging by adding '-x' without explicit 'set'
command in the script. Only if some script gets the status of
a "standard-command" I regularly use I set the shebang. YMMV.

(So you don't "need" a shebang line, but it's useful.)

>    (good practice, always add the shebang)

Yes, if you are running your scripts executable script (or if
you want to give your editor a hint for syntax highlighting,
what shell is actually used, or just for specification purpose;
but note, as said above, that we see many people have no clear
idea about what a "/bin/sh" is and where /bin/bash or /bin/ksh
differ from the standard.

Janis
Technical Details
Message-ID: <11bhv61$1bjd2$2@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <18dee4b6cab427fa$865$2574533$802601b3@news.usenetexpress.com> <POycnb0WPpTmPEz3nZ2dnZfqn_ednZ2d@giganews.com> <87ik32455m.fsf@solcaium.us> <6ad33478$0$28048$426a74cc@news.free.fr> <11b0ms8$iems$8@dont-email.me> <11b0pbe$3pvda$2@dont-email.me> <83se20c7ao.fsf@helmutwaitzmann.news.arcor.de> <11bg381$1bjd2$1@dont-email.me> <RH-dnS_Dp6SSsEH3nZ2dnZfqnPednZ2d@giganews.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.os.linux.misc,comp.unix.shell
Subject: Re: Back To CS Basics. Fuck AI
Date: Sat, 24 Oct 2026 11:53:05 +0200
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <11bhv61$1bjd2$2@dont-email.me>
References: <18dee4b6cab427fa$865$2574533$802601b3@news.usenetexpress.com>
 <POycnb0WPpTmPEz3nZ2dnZfqn_ednZ2d@giganews.com> <87ik32455m.fsf@solcaium.us>
 <6ad33478$0$28048$426a74cc@news.free.fr> <11b0ms8$iems$8@dont-email.me>
 <11b0pbe$3pvda$2@dont-email.me>
 <83se20c7ao.fsf@helmutwaitzmann.news.arcor.de>
 <11bg381$1bjd2$1@dont-email.me>
 <RH-dnS_Dp6SSsEH3nZ2dnZfqnPednZ2d@giganews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 24 Oct 2026 09:53:06 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1428898"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+28lODsdpxYc03opeU4l9A"; posting-host="0a512dbfa7a992d5d270056d8b27f0f3"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mNtBOW5JsIglWJKMOBEO3t9RySo= sha256:OIWL4n4zNl+sUL10SkI7V5nBGjQvloDPLIIweo9yzRo=
	sha1:fpbv+GRmRoHGKO0OrAVcHxtaD90= sha256:cEz/TYAIkDHXG6heRUryneFIWoNI4h+kErGT54mkGyk=
Content-Language: en-US
In-Reply-To: <RH-dnS_Dp6SSsEH3nZ2dnZfqnPednZ2d@giganews.com>