Article View: comp.unix.shell
Article #244Re: Back To CS Basics. Fuck AI
From: c186282
Date: Mon, 26 Oct 2026 07:15
Date: Mon, 26 Oct 2026 07:15
385 lines
17823 bytes
17823 bytes
On 10/26/26 01:04, Janis Papanagnou wrote: > 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 following exposition explains why. > 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. Well, good for them. I'll stick to my philosophic "Functional Convergence" theory here. If shell X does something neat-o then it HAS to be incorporated into all others - some way, some how, neat or not. > (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 think it makes good sense. Everybody just HAS to somehow incorporate everyone else's good ideas eventually. Otherwise --> TRASH BIN of history. >> 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. As said, CSH did initially attract me to -IX. However don't really USE it anymore. HAVE tcsh installed though, Just In Case. Good idea, but didn't "evolve" enough. >> 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". VERY messy and OFTEN 'cryptic' (unless very short). Just no NEED for such shit anymore. >> 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"). But NOT 'comprehensible' a year or two LATER. Been there, experienced/suffered that. Python is MUCH better in that respect. Didn't matter if I wrote the thing, the logic/sense of it DECAYS with time no matter HOW many comments/doc. I had a 40+ year career ... even 'simple' scripts/pgms, the whole sense/sensibility decayed over time. It all seems SO clear WHEN you're writing it, but ...... Note a good third of my 'programs' at least were COMMENTS - by-line PLUS an informative header at the top of each function. Two or three years later, revision time - "WHAT The Fuck ???". >> (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.) I very much mean to encrypt the backups BEFORE you send them to 'cloud'. Don't put un-encrypted shit on their sites for a millisecond. Do NOT trust them ! AES-xxx is good, though sometimes used Camilla. With several langs/FTP you can put a file on 'cloud' and then set the datetime/ownership to whatever the original had. That's how I did it for a decade+ - works very well. Encrypt, upload, then tweak the specifics. Pirates get NOTHING. >> 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. Do you disagree ??? >> 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". Slightly - but also CLUNKY and hard to understand a year or two later. Doing serious string stuff in BASH and several others ... nasty ! Look, if you're 20-something it MAY be possible to hold all the sense/logic of older shit in your head. Believe me - that CHANGES. Too much shit on a small drive, so to speak. >> 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.) Um ... check. Almost all the Python string shit was 'borrowed' from FORTRAN. This is a GOOD thing. SO often you have to slice and dice and squish string stuff together in the real world. It'd better be EASY and OBVIOUS or you're doomed. >> 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. Python is now 'standard enough' - and totally ubiquitous. FIRST place I started seeing a lot of Python wasn't Linux, but WINDERS. Had to learn a little P2 just because. Found, despite initial prejudice, I didn't hate it ...... >>>> 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. Umm ... what IS this 'ksh'-defaulting distro ??? > 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.) OFTEN not a 'good idea' ... but sometimes "an IDEA", a brain-worm that commands you to "do this it tcsh" ! :-) > 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.) Never got TOO far into ZSH ... but it DOES have a lot of potential. Don't count it out of the picture. >> 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.) Experiences vary. Needs vary. As said somewhere, I'm not "religious" in any of this stuff - shells/langs/distros. Whatever is best for The Job. If "Plan-9" or Solaris seem to serve best then USE them. NOT much use for Winders these days, not at all. A code/method CESSPIT full of spyware and worse. Bought five of those "mini-boxes", BMax/BeeLink, a couple years back when they were cheap. Kinda "lower-end laptop" power. However with -IX the performance is very good. Kinda a matter of pride to not let Winders run for a single millisecond before I install an -IX. Did add SATA SSDs to three of them (again cheap before the tariff wars). These are my home backbone now, do everything I want as fast as I need. Even have one as a de-facto NAS box with a bunch of USB drives attached. (Oh, DON'T disagree with the tariff wars ... were kinda NEEDED in my opinion. BAD idea to let China Own All). Alas no USA/EU/Taiwan makers seemed to step up to the challenge, at least not yet) REALLY simple/dedicated uses - and HAVE several - just use PIs. Note had a HORRIBLE/useless experience with a SUPPOSED SATA hat. Spent a week trying to get it to work - NADA ! Still have several PIs pretending to be IP cameras and smart displays however. P3s work as IP cams fine, P4s are good for smart displays of the images, P5s ... um ... they're kinda too weird/expensive right now. Have one, don't use it for anything. (note there are cheap weather-proof boxes that will JUST fit a Pi-3 and a mini-board camera. Use "motion" for the cam. Have two of those running very well right now. Scripts even compensate for varying day/night times. Two cams on one mini-box also, again the day/night script. Note the PI3s ... kept locking up after about a week. Tried the simple solution of forcing a reboot, but that tended to hang. Clue - force all Python stuff to STOP just before the reboot. Now they run for months) Have two Pi-0/W2 boards. Might fit an even smaller waterproof box. Testing. Less power than a Pi3, but still MAYBE just enough if you stick to a low frame rate. "-IX" is just MUCH better and more efficient and less trashy than Winders. Have one with "GhostBSD" which is a good FreeBSD alt - easier to install and a nice GUI. Got into -IX a little back in the 386 days, remember SCO ?, but the boss decided against using it. Maybe smart back then. The goal was to write a database and GIS in it. However 'cheap'/useful/better' ones came out for Winders soon. Old commercial -IX systems were EXPENSIVE too. 'AREV' for the database, multi-value. LOVED it ! Kinda steep learning curve though, DO check the 'advanced' shit at the back of the manuals. You can STILL buy it, but no support and DOS mem lims. STILL kinda interested in Solaris/OpenIndiana. Unix-LIKE ... SOME interesting aspects and NOT Winders at all. More experiments coming. The storage set-up IS weird though ... more for 'giant' systems. Don't need that now. Oh well, went too long/wide again ...
Technical Details
Message-ID:
<pLicnXyiRtu-Y0P3nZ2dnZfqn_GdnZ2d@giganews.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!weretis.net!feeder9.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!news.giganews.com.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> <11bmn1r$36mvl$1@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!weretis.net!feeder9.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!local-1.nntp.ord.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 26 Oct 2026 07:15:47 +0000 Date: Mon, 26 Oct 2026 03:15:57 -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> <YqednV4C15lKUEP3nZ2dnZfqn_adnZ2d@giganews.com> <11bmn1r$36mvl$1@dont-email.me> Content-Language: en-US From: c186282 <c186282@nnada.net> Organization: wokiesux In-Reply-To: <11bmn1r$36mvl$1@dont-email.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <pLicnXyiRtu-Y0P3nZ2dnZfqn_GdnZ2d@giganews.com> Lines: 385 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-NHj2sLecwbrVSBsww6l+YsYiIA986tSJWZVvKtYnMd4zEHjM269gVXmzj6ibyy7YLUAzv5kTb6+5dZq!m4fOHOfZ3v/O/7e51+nKDN9MmS31A76UtEHYdFaimxqGdHDMIDuC9Vq6q933ZTVEOLysLmo6SDc= 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