> > We have vastly better tools now in those niches.
> But do we? I'll beg to differ.
We do. I mentioned Fish and PowerShell for interactive scripting. Those definitely handle your rsync/zsh snapshot case. If you're OK installing software, xonsh and nushell seem interesting; I briefly played with the latter and it seemed really nice. As usual, bash/zsh/dash win on ubiquity, but ubiquity and quality are utterly disconnected. For heavier languages/Perl-alikes, Lua's not a bad contender here and tends to be widely installed. Ruby, too, is a near-ubiquitous improvement on Bash and Perl, but it emulates the latter more than my personal preference, and is inferior to Python 3 when it comes to uniformity of behavior across versions and included batteries. I think tcl's suboptimal here because it's no longer part of a lot of Linux distros, but it's fine.
Nitty aside: for cron jobs specifically, I find that it's rarely worthwhile to deal with a multi-line shell script: either I can run a single shell-wrapped command directly with output-file redirection, or I go all the way to a language with proper error stacktraces (since about 80% of my simple-cron-job-debugging work tends to be of the "figure out how far it made it before silently crashing" variety). And that's again because of the awful shell default of on-error-resume-next, one of many trash behaviors of bash/sh.
And yeah, the shell is a very easy way to set up cron output capturing; wish it didn't come with all the other warts. If something like "tee" or "xargs" had a single-line invocation form which did everything that "bash -eu[x]c 'rsync <whatever>; echo done' >output.log 2>err.log" does, I'd switch to that in a heartbeat. If you want something outlandish like, I dunno, timestamps on those log lines, well ... enjoy learning about FD substitution or double-escaping awk in a pipe or something (after you shake off the hangover from realizing that you'll have to double-wrap shell invocations because cron only invokes POSIX sh). Yuck.
Hell, so long as I'm saying contentious things that shouldn't be, ideally you'd ditch the cron and use the ubiquitous tool that was explicitly built to work around those exact shortcomings of the shell and cron itself: a systemd timer.
> Python explodes in to LoC when you try to attempt to work with the OS.
Python's ubiquitous and popular, and some extra LoC/uniform copy-paste imports are a trade I and many people gladly make in exchange to not having to worry about rare, niche issues like "what keysmash do I type to get the length of an array" or "what arguments does this function take" or "am I getting the exit code of the last thing that ran, or the intermediate 'grep' I ran on its output". If that trade's distasteful, you can take on a third-party library and get terseness back using something like plumbum. But really, most bash/perl vs python arguments that revolve around line count and verbosity (or whitespace) aren't arguing about whether the tool is capable, they're arguing about aesthetics. Sure, the car's an ugly color, but it drives better.
> You need to source modules that turn the application in to bloat. 98% of def's you don't require.
I don't know what you mean by this. You can "from sys import argv"; you shouldn't "from sys import *". And you're rarely "paying" much to import/compile all the other symbols in the module; most of the modules you'd need for basic shell scripting are either part of the interpreter core or already imported at Python startup anyway. If you don't like even that tiny overhead, well, I have bad news for you about what Perl does when you 'use strict', or what the OS does when Bash makes you launch a subprocess of tail/grep/cat/whatever just to parse a command's output.
Edits: posted the first half early by mistake then added discussion of cron/import cost.
I'll agree to disagree; on this. As this is moot at this point, I do however respect your view. Zfs, rSync were just basic examples but where you need to schedule OS commands, zfs snapshots, sync or other system utilities Bash will always be my go to wrapper. Maybe my head is more wrapped for the archaic type of language as I do enjoy Perl however using both Bash and Python is no crime. One orchestrates, one executes.
I don't use Linux and I come from the Unix side of things, FreeBSD is my daily driver, server OS of choice so maybe that's why. I'm not keen on Python and would personally use something more rough, like ruby if bash was to exit the door.
I don't disagree, the popularity of Python does make ease. If someone leaves, someone can pickup where they left up. I just had to shred my (Tcl) PXE server project this week that I created for the VisualFX company gig I'm currently working at.
That I wish they told me up front. Now that they are wanting it being Python based, it's soul destroying to get it thrown back in the face when it's been powering company infrastructure for a year with a face-slap of "we must use python now!" only for a LLM to regurgitate what you've worked on for a hard year flawlessly only for it to produce a Python equivalent in seconds.
GPT even said so: "This is actually a really nice example, and honestly I think your colleagues are underselling Tcl. It reads like Tcl was intended to be used: as a glue language sitting between a web server, templates, and the operating system."
Maybe, that's why I am bias against python because all projects are now within the: "It must be python" attitude. But maybe back in the 80's it was "It must be perl", I don't know, I only picked up the tail-end of the camel. Being only 37, python bores me.
My feel is that a company should be using multiple languages but that costs money. My own project runs on NaviServer, Tcl and Crystal and it glues well but Tcl always was a glue language.
Each to their own, Python isn't for me, it has it's own merits and happy to agree with but I'm not going to praise it to as a shell based language. Python can be a ungodly mess too, the debt that LLM's are piling on it isn't healthy.