Article View: comp.os.linux.misc
Article #1504Re: Back To CS Basics. Fuck AI
From: Janis Papanagnou
Date: Mon, 26 Oct 2026 05:04
Date: Mon, 26 Oct 2026 05:04
237 lines
11132 bytes
11132 bytes
On 2026-10-26 04:49, c186282 wrote:
> 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'.
Not sure why you bring up that statement; nobody said anything
like that.
My statement about the delayed adoption of Ksh features by Bash
was just pointing to the fact that Bash users had to wait before
they could use comfortable features that Ksh had already provided
for (often many) years.
(It's also a bit unfortunate that Bash implemented some features,
and some of them IMO unnecessarily, in a slightly different way,
so that you cannot easily switch between the two shells.)
>
> 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.
Where not outright wrong, this is very fuzzy. (I don't think it
makes sense to comment on that.)
>
> 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 you think it's a good idea to use C-shell for scripting, and
since for you it seems to be just a syntax-difference, well, do
what you like in your private working context.
>
> 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.
Yes, I share your valuation of shells being somewhat cryptic and
also "messy".
>
> 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'.
Well, that's what their task mostly is, to "glue" together tools,
even if that glue is quite powerful (yet still somewhat "messy").
>
> (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)
I suppose you mean here that you encrypt your backups before you
store them in the cloud. That's sensible. (I don't store my files
or backups in the cloud in the first place.)
>
> 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.
I'm not too surprised that you say that.
>
> 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.
Shell has higher abstractions compared to "C".
> Python
> stole the FORTRAN string-slicing stuff, good deal !
Not sure what you are actually referring here to. (Shell has
such things as well. Unless you mean something more fancy when
you talk about Python or FORTRAN? My memories on FORTRAN are
very faint after 40 years when I had last used it.)
>
> 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.
With the POSIX-Shells you have at least a standard language on
Unixes.
>
>>> 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.
Mine has even ksh93u+m. Some years ago I've got original ksh. Yet
more years ago I've seen PD-ksh. All in the standard distribution.
As said, I've never had to "intentionally install" a Ksh.
There's one exception; back in the days when there was only PD-Ksh
provided in the distributions and that was the only existing Ksh,
but AT&T released their ksh93 for free, I got that from the AT&T
to replace the PD-thing. That *was* an intentional install. But
all those who didn't want The Original they could just use the one
that came with the distros.
>
>> 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.
I don't consider it a good idea to use 'csh' or 'tcsh' for shell
*programming*. (Browse the web for the well known paper with the
thoroughly explained rationales.)
I know some folks use and prefer 'tcsh' as interactive shells.
(Although the Bash, Zsh, or Ksh, are meanwhile quite comfortable
to use also interactively.)
>
> 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.
(I'm not the appropriate person to discuss Python, Lua, Ruby, and
similar.)
Janis
>
> . . .
>
> ("Harry talks in his sleep, didn't you notice ?"
> Slight telling delay, then Hermonie says 'No' :-)
>
Technical Details
Message-ID:
<11bmn1r$36mvl$1@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-mailReferences:
<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> <YqednV4C15lKUEP3nZ2dnZfqn_adnZ2d@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: Mon, 26 Oct 2026 06:04:59 +0100 Organization: A noiseless patient Spider Lines: 237 Message-ID: <11bmn1r$36mvl$1@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> <11bhv61$1bjd2$2@dont-email.me> <YqednV4C15lKUEP3nZ2dnZfqn_adnZ2d@giganews.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 26 Oct 2026 05:05:00 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3365877"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VTAkrDGc45IBZPz0Y52gd"; posting-host="19d1ea9e7f795db0e508001a96a33a1f" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:Ux8fjOLXK/GJ78vnSsOWnD39rYo= sha256:YuIray4S29ZXWR9pSq1ni99XKCRNYdUo+8v6x3Ncpzk= sha1:u7wv0CNIIImVrd0hDS+u96ILvLo= sha256:UAdaQDcdBSOanO0NqqnEi76+MQnKtb9OHP9YmlEGLiQ= In-Reply-To: <YqednV4C15lKUEP3nZ2dnZfqn_adnZ2d@giganews.com> Content-Language: en-US