Now, there are almost no more interpreted scripts.
On 17 Oct 2026 08:40:24 GMT, St‚phane CARPENTIER wrote:
Now, there are almost no more interpreted scripts.
Shell scripts are still interpreted. Not only that, but the shell
actually seeks through the source file to do a transfer of control.
How do I know this? Try making changes to the script while it is
running. ;)
On 2026-10-17 22:47, Lawrence D?Oliveiro wrote:
On 17 Oct 2026 08:40:24 GMT, St‚phane CARPENTIER wrote:
Now, there are almost no more interpreted scripts.
Shell scripts are still interpreted. Not only that, but the shell
actually seeks through the source file to do a transfer of control.
How do I know this? Try making changes to the script while it is
running. ;)
I've just done this ("a script change while it's running") [*]
(with ksh and bash) and there was no change in behavior of the
running script.
You may want to provide an example what you've actually done
to come to that conclusion (or reformulate your conclusion).
BTW; I've in other (more complex?) contexts observed that some
intrusions (tackling the shell program while it runs) do affect
the running script, but back then I haven't examined the reason
or circumstances of that effect, or whether it's some effect of
an interaction with the OS. - So the principle question, what
exactly happens in what circumstances, is still interesting.
Janis
[*] What I've done was to run the following script "dynchg.sh"
while read ; do
echo $REPLY
done
and change it (from another terminal) while it runs by
sed -i '2p' dynchg.sh
I could even remove that file from the directory and it still
processes data as expected. And there's also no difference if
that program is explicitly run with the interpreter or running
it using a shebang interpreter as executable script.
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
On 2026-10-17 22:47, Lawrence D?Oliveiro wrote:
On 17 Oct 2026 08:40:24 GMT, St‚phane CARPENTIER wrote:
Now, there are almost no more interpreted scripts.
Shell scripts are still interpreted. Not only that, but the shell
actually seeks through the source file to do a transfer of control.
How do I know this? Try making changes to the script while it is
running. ;)
I've just done this ("a script change while it's running") [*]
(with ksh and bash) and there was no change in behavior of the
running script.
You may want to provide an example what you've actually done
to come to that conclusion (or reformulate your conclusion).
BTW; I've in other (more complex?) contexts observed that some
intrusions (tackling the shell program while it runs) do affect
the running script, but back then I haven't examined the reason
or circumstances of that effect, or whether it's some effect of
an interaction with the OS. - So the principle question, what
exactly happens in what circumstances, is still interesting.
Janis
[*] What I've done was to run the following script "dynchg.sh"
while read ; do
echo $REPLY
done
and change it (from another terminal) while it runs by
sed -i '2p' dynchg.sh
I could even remove that file from the directory and it still
processes data as expected. And there's also no difference if
that program is explicitly run with the interpreter or running
it using a shebang interpreter as executable script.
If your remove the script while it's still running, chances are the interpreter still has it open, so the data is not removed until the file
is closed---that is, you don't more free space until every reader and
writer have closed the file. That's the typical UNIX semantics of open files. (If I understood the problem here correctly.)
I have learned not to edit a script while it was running, weird things happened when I did. My theory was that bash kept an index pointing to
the current line. Dunno if as byte or as line.
On 2026-10-17 22:47, Lawrence D?Oliveiro wrote:
I've just done this ("a script change while it's running") [*]
[*] What I've done was to run the following script "dynchg.sh"
while read ; do
echo $REPLY
done
and change it (from another terminal) while it runs by
sed -i '2p' dynchg.sh
GNU sed doesn't modify the original shell script, which hasbeen opened by the shell.
I could even remove that file from the directory and it still
processes data as expected.
Janis Papanagnou <janis_papanagnou+ng@hotmail.com>:
On 2026-10-17 22:47, Lawrence D?Oliveiro wrote:
I've just done this ("a script change while it's running") [*]
[*] What I've done was to run the following script "dynchg.sh"
˙˙ while read ; do
˙˙˙˙˙˙ echo $REPLY
˙˙ done
and change it (from another terminal) while it runs by
˙˙ sed -i '2p' dynchg.sh
As the "-i" option is not defined by the POSIX standard but by GNU sed,
I assume that your example uses GNU sed.
[...]
On 2026-10-21 00:54, Helmut Waitzmann wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com>:
On 2026-10-17 22:47, Lawrence D?Oliveiro wrote:
I've just done this ("a script change while it's running") [*]
[*] What I've done was to run the following script "dynchg.sh"
˙˙ while read ; do
˙˙˙˙˙˙ echo $REPLY
˙˙ done
and change it (from another terminal) while it runs by
˙˙ sed -i '2p' dynchg.sh
As the "-i" option is not defined by the POSIX standard but by GNU
sed, I assume that your example uses GNU sed.
Yes. (I've just used '-i' for simplicity.)
A better example would have been to issue (from another shell window)
the command
˙˙ echo "echo END" >> dynchg.sh
and we then see that after terminating the above loop the "END" will
be printed.
(I'm testing with ksh but suppose that in bash it would be similar.)
˙ 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.
[...]
˙ If KSH works for you then stick with it.
Note however that MOST distros default to BASH now -
so if you plan
˙ to 'distribute' your work it'd be better to move your
˙ stuff over to BASH.
Most distros, users would have to
˙ intentionally install KSH and scripts would need a
˙ shebang at the top to specify which shell to use.
˙ (good practice, always add the shebang)
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.
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).
On 2026-10-24 05:59, c186282 wrote:
Note however that MOST distros default to BASH now -
Yes, Linux often has Bash as its default.
In article <11bhv61$1bjd2$2@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> 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).
I think you're taking Speedy way too seriously here. All of your points
are valid, of course, but it should not be necessary to respond to the
troll.
BTW, you assert that there are (many) features of Ksh that are not (yet) present in bash. I'm not doubting you, but I am curious about examples.
It seems to me that if you assert something like that, you should give examples.
Le 24-10-2026, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> a ‚crit˙:
On 2026-10-24 05:59, c186282 wrote:
Note however that MOST distros default to BASH now -
Yes, Linux often has Bash as its default.
I just keep this because I guess, if I don't consider it to be wrong
because I know what it exactly means, I believe it's often a source of confusion. Because it can mean two different things and three different things must be considered when speaking about the default shell.
Mostly, BASH is the default for the three things, one of them can be
changed effortlessly, one of them would be very difficult to change in
the long term and the last one depend on the interaction with others.
The first thing is the way by which you interact directly with your
SHELL, a kind of REPL. It's just a field in the /etc/passwd file, it's
easy to change and if you prefer any SHELL, just install it, change the
field and it rocks. It's just a matter of taste, nothing can go wrong by changing it.
The second thing is the shell used by the distro to run its script. This
one is clearly often BASH, changing it can be challenging. And things
can go wrong in a lot of ways, from the shebang poorly defined to some specificities expected by the distro. But really, I'm not sure it's a
real issue because I'm not sure there are reason to change it. The
fact that systemd doesn't need any shell script is a reason why it's nit
that important. One can want to change the default provided by the
distro, but changing the script shell provided by the distro mean each
time an update is done, the changes will be removed. And they will need special care. When there are ways to change the default without changing
the scripts provided by the distro.
The second thing is the shell used by the distro to run its script.
This one is clearly often BASH, changing it can be challenging. And
things can go wrong in a lot of ways, from the shebang poorly
defined to some specificities expected by the distro.
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.
On 2026-10-24, 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.
Now that sounds like something Greg Sullivan of Microsoft would say.
On 2026-10-24 14:10, Kenny McCormack wrote:
In article <11bhv61$1bjd2$2@dont-email.me>,
Janis Papanagnou˙ <janis_papanagnou+ng@hotmail.com> 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).
I think you're taking Speedy way too seriously here.˙ All of your points
are valid, of course, but it should not be necessary to respond to the
troll.
Oh, I didn't knew that he's considered a troll. His post looked just uninformed, or opinionated, not trollish.
BTW, you assert that there are (many) features of Ksh that are not (yet)
present in bash.˙ I'm not doubting you, but I am curious about examples.
It seems to me that if you assert something like that, you should give
examples.
Mind that his post says "Minor diffs"; and I was not (not primarily) addressing the absolute number of features but those features that
are hard(er) or in practice impossible [based on existing functions]
to substitute. Off the top of my head I had been thinking of discipline functions, or the "type system" - these are very closely embedded in
the shell.
Note that while these features are probably not widely used there's
also many often used details I used, functions and options, that Bash
doesn't have as I noticed over the time. I've occasionally mentioned
those in some posts that where about such functionality, but I'm too
lazy to create a list or something, which would require to re-test
every features whether one or another has meanwhile been implemented;
that would be too much effort.[*])
Janis
[*] After finishing writing the post I remembered that we could ask
a search machine AI, but strangely it had no or found any substantial information, not even the obvious examples; so we have to rely on the
experts or own experience here.
In article <11bhv61$1bjd2$2@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> 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).
I think you're taking Speedy way too seriously here. All of your points
are valid, of course, but it should not be necessary to respond to the
troll.
BTW, you assert that there are (many) features of Ksh that are not (yet) present in bash. I'm not doubting you, but I am curious about examples.
It seems to me that if you assert something like that, you should give examples.
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' :-)
On 10/24/26 12:53, Janis Papanagnou wrote:
On 2026-10-24 14:10, Kenny McCormack wrote:
In article <11bhv61$1bjd2$2@dont-email.me>,
Janis Papanagnou˙ <janis_papanagnou+ng@hotmail.com> 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).
I think you're taking Speedy way too seriously here.˙ All of your points >>> are valid, of course, but it should not be necessary to respond to the
troll.
Oh, I didn't knew that he's considered a troll. His post looked just
uninformed, or opinionated, not trollish.
˙ Thanks, I think˙ :-)
˙ I never 'troll' - just relate MY experiences and what
˙ I've learned from them. I had my own path, own needs,
˙ my own 'environments', starting in the punch-card days.
˙ But what served ME best may not be what served YOU, what
˙ I learned may not be what YOU learned.
˙ A great purpose of groups like these is to bring in
˙ a LOT of experiences and perspectives. You MAY find
˙ something compatible/useful in all the diverse advice.
˙ I don't pretend to know-it-all, nothing close (though
˙ a few, well, SAY they do :-)
˙ As said elsewhere, "NEED" eventually supersedes all else.
˙ Earlier on, all the shells maybe started with a narrow
˙ 'vision' but HAD to include capabilities the other people
˙ put in. Sometimes the additions were neat/clear, sometimes
˙ not so much, but they're THERE.
˙ A sort of 'functional convergence' due to NEEDS.
˙ Anyway, I reject 'religions' built around shells or
˙ langs and such. For each need, pick the best tools
˙ and approaches. "Best" - sometimes that's what most
˙ harmonizes with YOUR brand of thinking.
[...]
On 10/24/26 07:06, Nuno Silva wrote:
On 2026-10-24, 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.
Now that sounds like something Greg Sullivan of Microsoft would say.
˙ You "can do" most anything in COBOL or FORTRAN or 'C'
˙ in ANY other lang - just as anything in one shell script
˙ you can do in any other. The issue is 'how easily' - and
˙ that depends on your particular application.
[...]
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.)
On 2026-10-26 05:28, c186282 wrote:
On 10/24/26 12:53, Janis Papanagnou wrote:
On 2026-10-24 14:10, Kenny McCormack wrote:
In article <11bhv61$1bjd2$2@dont-email.me>,
Janis Papanagnou˙ <janis_papanagnou+ng@hotmail.com> 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).
I think you're taking Speedy way too seriously here.˙ All of your
points
are valid, of course, but it should not be necessary to respond to the >>>> troll.
Oh, I didn't knew that he's considered a troll. His post looked just
uninformed, or opinionated, not trollish.
˙˙ Thanks, I think˙ :-)
˙˙ I never 'troll' - just relate MY experiences and what
˙˙ I've learned from them. I had my own path, own needs,
˙˙ my own 'environments', starting in the punch-card days.
(I've still a block of punch-cards in the cellar, so I've got an
impression where you're coming from.)
˙˙ But what served ME best may not be what served YOU, what
˙˙ I learned may not be what YOU learned.
Oh, in my previous reply I said something like that; that it's
fine if it serves you in your private contexts.
A discrepancy might appear when you are working in a larger area
with rules that are not tailored to your personal likings but to
experiences from a larger (or another) group of persons.
˙˙ A great purpose of groups like these is to bring in
˙˙ a LOT of experiences and perspectives. You MAY find
˙˙ something compatible/useful in all the diverse advice.
˙˙ I don't pretend to know-it-all, nothing close (though
˙˙ a few, well, SAY they do :-)
Oh, I'm completely fine with that. - If statements are formulated
as opinions, what else can we do than agree to those or disagree.
A problem, though, is, when opinions are stated as facts, and if
statements are even wrong, then they should be corrected. (Or
clarified if it was just a communication or expression problem.)
˙˙ As said elsewhere, "NEED" eventually supersedes all else.
˙˙ Earlier on, all the shells maybe started with a narrow
˙˙ 'vision' but HAD to include capabilities the other people
˙˙ put in. Sometimes the additions were neat/clear, sometimes
˙˙ not so much, but they're THERE.
˙˙ A sort of 'functional convergence' due to NEEDS.
˙˙ Anyway, I reject 'religions' built around shells or
˙˙ langs and such. For each need, pick the best tools
˙˙ and approaches. "Best" - sometimes that's what most
˙˙ harmonizes with YOUR brand of thinking.
(Unfortunately language topics are often presented with religious
fervor.)
On 2026-10-26 04:59, c186282 wrote:
On 10/24/26 07:06, Nuno Silva wrote:
On 2026-10-24, 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.
Now that sounds like something Greg Sullivan of Microsoft would say.
˙˙ You "can do" most anything in COBOL or FORTRAN or 'C'
˙˙ in ANY other lang - just as anything in one shell script
˙˙ you can do in any other. The issue is 'how easily' - and
˙˙ that depends on your particular application.
(Be careful; if your argument goes in the direction of "language A
is Turing-complete so you can use it simulating language B, which
makes it effectively the same", then that statement would be of no
practical value!)
I want to give you an example code from a little shell tool I wrote:
˙ function LINES.set { .kosta.rows=${.sh.value} ; .kosta.update ;}
(What this does is that whenever the environment variable 'LINES'
changes - e.g. if you pick your mouse and resize the X-window - then
that function gets triggered and the actions defined executed.)
I'd be interested how you'd implement or emulate that, say, in Bash.
I want to give you an example code from a little shell tool I wrote:
function LINES.set { .kosta.rows=${.sh.value} ; .kosta.update ;}
(What this does is that whenever the environment variable 'LINES'
changes - e.g. if you pick your mouse and resize the X-window - then
that function gets triggered and the actions defined executed.)
I'd be interested how you'd implement or emulate that, say, in Bash.
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
[...]
I want to give you an example code from a little shell tool I wrote:
function LINES.set { .kosta.rows=${.sh.value} ; .kosta.update ;}
(What this does is that whenever the environment variable 'LINES'
changes - e.g. if you pick your mouse and resize the X-window - then
that function gets triggered and the actions defined executed.)
I'd be interested how you'd implement or emulate that, say, in Bash.
I do something similar in bash, but using a different mechanism (so this isn't a response to your challenge).
I trap on SIGWINCH.
On 10/26/26 01:41, Janis Papanagnou wrote:
On 2026-10-26 04:59, c186282 wrote:
On 10/24/26 07:06, Nuno Silva wrote:
On 2026-10-24, 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.
Now that sounds like something Greg Sullivan of Microsoft would say.
˙˙ You "can do" most anything in COBOL or FORTRAN or 'C'
˙˙ in ANY other lang - just as anything in one shell script
˙˙ you can do in any other. The issue is 'how easily' - and
˙˙ that depends on your particular application.
(Be careful; if your argument goes in the direction of "language A
is Turing-complete so you can use it simulating language B, which
makes it effectively the same", then that statement would be of no
practical value!)
˙ I know I will offend The Religious.
˙ Fuck 'em.
˙ Task, BEST solution for YOU. That is The
˙ Standard so far as I'm concerned.
I want to give you an example code from a little shell tool I wrote:
˙˙ function LINES.set { .kosta.rows=${.sh.value} ; .kosta.update ;}
(What this does is that whenever the environment variable 'LINES'
changes - e.g. if you pick your mouse and resize the X-window - then
that function gets triggered and the actions defined executed.)
I'd be interested how you'd implement or emulate that, say, in Bash.
˙ I'd write it in PYTHON now˙ :-)
˙ Some OS.System() and maybe Subprocess calls.
˙ Leverage the existing simple/low-level utils
˙ in Linux to your advantage. Run, parse,
˙ mutate, USE.
˙ Done a lot of apps that simply grab output
˙ from those simple Linux utils - then parse
˙ and trim and mix. Why re-invent the wheel ?
˙ You CAN - but WHY ???
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:
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.
[snip Csh talk]
˙˙ 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.
[snip Python talk]
˙˙ (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.
[snip]
˙˙ 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 ???
[snip]
[...]
˙ Never got TOO far into ZSH ... but it DOES have a lot
˙ of potential. Don't count it out of the picture.
[big snip of digressions]Janis
˙ My first computer was a PDP-11. Great unit.
˙ But still remember having to submit my card
˙ stack (DON'T drop it !) to the IT overlords.
˙ Helped a bit if you offered them 'gifts'.
On 2026-10-26 08:38, c186282 wrote:
[...]
˙˙ My first computer was a PDP-11. Great unit.
˙˙ But still remember having to submit my card
˙˙ stack (DON'T drop it !) to the IT overlords.
Corrupted data (if you've dropped it)...
˙˙ Helped a bit if you offered them 'gifts'.
...and corrupted people?
Janis
PS: The nastiest thing I've encountered with the
card deck was that a friend exchanged all my cards
which carried the word 'BEGIN' with cards carrying
the word 'SADAT' - just as a hilarious play with
words WRT two international politicians back then.
Not so funny for me when I noticed all the syntax
errors and had to wait another hour for the next
batch run.
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 498677:42:57 |
| Calls: | 212 |
| Calls today: | 3 |
| Files: | 912 |
| D/L today: |
31 files (22,593K bytes) |
| Messages: | 69,841 |