🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.linux.misc
Article #1497

Re: Back To CS Basics. Fuck AI

#1497
From: c186282
Date: Mon, 26 Oct 2026 03:49
156 lines
8278 bytes
On 10/24/26 05:53, Janis Papanagnou wrote:
> 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*.)

   Delay does not necessarily equate with 'ignorance'.

   Different developers ... everyone had their own idea
   of a 'perfect shell' - but then had to adapt and adapt
   again as the Real Needs became more obvious. Now, most
   WILL do the same things - just slightly different syntax.

   I rather liked the 'c-shell' long back because it, well,
   'looked like C'. It was one of the things that attracted
   me to Unix/Linux in the first place. Now I'm happy (ok,
   that's not really the word) with BASH. Not much it
   can't do ... but the fudged-fudged-fudged syntax to add
   features over time CAN be a pain in the ass.

   If I want 'scripting' now, I do it with Python. BASH
   or whatever, maybe it just EVOKES the Python scripts,
   a one or two-liner. Wrote many rather long BASH scripts
   in the past, and while they worked they were, well, just
   TOO messy/cryptic.

   Last big BASH script I did was for backing up a bunch
   of on-network drives. Mount-checking (important), calls
   to rsync and openSSH and ftp, local AND 'cloud', all
   with some confirmation checks along the way. SEMI-repeating
   units but each was a bit 'special'.

   (ALWAYS pre-encrypt before sending to 'cloud' - I do
   NOT trust the providers one bit. Mine had an extension
   that 'suggested' some kind of ZIP, just to help them
   waste time)

   RE-did it in Python. MUCH shorter and more comprehensible
   and a nice easy CSV config file you could tweak in a text
   editor or spreadsheet. Python made it all BETTER.

   Had a 'C' version of that backup pgm earlier. Worked
   fine, but there was a lot of string checking/editing
   involved and 'C' is CLUNKY with string shit. Python
   stole the FORTRAN string-slicing stuff, good deal !

   Won't ever use BASH or any other 'shell script' for
   that kind of task again. Those might be "trad -IX"
   but IMHO they're just OVER. "Solutions" MOVED ON.

>>    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.

   Um ... these days, almost all distros, you do have
   to "intentionally install" KSH or any rivals. BASH
   rules by default.

> 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.

   Direct spec of the shell IS useful, however the
   'shebang' trick works well too.

> (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.

   I have, I think, FOUR shells on this machine. The
   shebang IS required/desired.

   Still kinda like 'tcsh', it's there in case I get
   a brain-worm and wanna fool around with olde-dayz
   stuff. Zsh ain't so bad either.

   But, as said, for 'scripting' now, Python is by
   far my #1 choice unless the script is like a
   simple little ten-liner. Tend to use those on
   my PIs.

   Fooled around a bit with Lua and Ruby for scripting,
   but, really, Python and the MASSIVE number of libs
   have them beat. Python will do ANYTHING these days,
   just not as fast as 'C'. However CPU speed is less
   of a thing these days - I/O ops drag things down
   more than the CPU - so Python and 'C' can usually
   compete pretty well.

   There are Python compilers too. The main issue there
   is all the sub-sub-versions of Python, so you always
   have to include the entire binaries into each compilation
   to ensure it'll work. But then space is also a minor
   issue now as well unless you're doing micro-controllers.
   Did my share of those - DO teach you how to really SQUEEZE
   shit in - all computer kiddies should learn MCs first.

   . . .

   ("Harry talks in his sleep, didn't you notice ?"
     Slight telling delay, then Hermonie says 'No' :-)
Technical Details
Message-ID: <YqednV4C15lKUEP3nZ2dnZfqn_adnZ2d@giganews.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.nrbbs.org!border-4.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!news.giganews.com.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> <11bhv61$1bjd2$2@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.nrbbs.org!border-4.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 26 Oct 2026 03:49:43 +0000
Date: Sun, 25 Oct 2026 23:49:28 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Back To CS Basics. Fuck AI
Newsgroups: comp.os.linux.misc,comp.unix.shell
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>
 <11bhv61$1bjd2$2@dont-email.me>
Content-Language: en-US
From: c186282 <c186282@nnada.net>
Organization: wokiesux
In-Reply-To: <11bhv61$1bjd2$2@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID: <YqednV4C15lKUEP3nZ2dnZfqn_adnZ2d@giganews.com>
Lines: 156
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-q8nXcUz3BapSVCDuH1SjnR65DmxdUv5EWVGdpXbwre12N2dlNuchMBDtkfpVaIWiGyhPj81Yijnx/NR!2Y1zdECaGTtnkfdFd0+hcUy5bDSTT25a3CBdXqAYnuARVdpgorq6vNlaHz/lrn6Z+AZrY515yAc=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40