• Re: Back To CS Basics. Fuck AI

    From Lawrence D?Oliveiro@3:633/10 to All on Saturday, October 17, 2026 20:47:05
    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. ;)

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Saturday, October 17, 2026 23:29:18
    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.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Anton Antimo@3:633/10 to All on Monday, October 19, 2026 17:18:41
    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.)

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Carlos E.R.@3:633/10 to All on Tuesday, October 20, 2026 10:54:25
    On 2026-10-19 22:18, Anton Antimo wrote:
    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.



    --
    Cheers, Carlos.
    ES??, EU??;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Kaz Kylheku@3:633/10 to All on Tuesday, October 20, 2026 17:38:24
    On 2026-10-20, Carlos E.R. <robin_listas@es.invalid> wrote:
    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.

    IIRC, here is how it works: bash reads the script via a buffered stream
    as it executes, thus some multi-kilobyte blocks of the script text. If
    you overwrite the script while it is running, it will not affect the
    script text that is already waiting in the buffer, but when bash
    reads to the end of the buffer, after that it will read the altered
    script. Therefore it is somewhat "unpredictable" where the discontinuity
    will occur: you have to know the buffer sizes and relate them to the
    script text.

    Earlier parts of the script are not re-read. Bash does not re-read code
    to iterate over a loop; the whole top-level command is parsed into an
    internal representation that is executed. If a script modifies its own
    source file, everything before and including that modifying command is
    "safe".

    There may be some subtleties with here docs. Suppose have
    a command ending in <<WORD followed by a large amount of here-doc
    data terminated by WORD. I don't know whether Bash reads all of it,
    or under what conditions. Probably when Bash runs on a system where
    here docs have to be done using temprary files, it does have to read
    all the data, put it into the temporary file and then launch the command
    with the <<WORD syntax replaced by the name of the temporary file.

    But on a system where the program can be given a /dev/fd/<n> syntax or
    whatever to refer to a file descriptor, bash can pipe the data to it.
    Maybe it is possible for the script to be modified after that command is launchedm such that the command receives different here doc data.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Helmut Waitzmann@3:633/10 to All on Wednesday, October 21, 2026 00:54:07
    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.


    GNU sed's "-i" option does not edit the file in place.˙ Rather it
    sends its output to a new file (instead of to standard output),
    then removes (or renames) the name of the original file.˙
    Finally, the name of the new file is renamed to be the no more
    existing name of the original file.


    GNU sed doesn't modify the original shell script, which has
    been opened by the shell.


    Therefore the shell won't see anything of the new file but rather
    stick to the already opened original file (even, if that original
    file hasn't got any file name).


    I could even remove that file from the directory and it still
    processes data as expected.


    Yes.˙ As long as the shell doesn't close the file descriptor
    accessing the original file, it will continue to access the
    original unmodified file.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Friday, October 23, 2026 18:50:09
    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.)

    Janis

    [...]


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Friday, October 23, 2026 23:59:17
    On 10/23/26 12:50, Janis Papanagnou wrote:
    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.

    There are MANY shells, of course. CSH and ZSH are 'more
    different' for example and it'd be a more complicated
    translation. Not impossible, just more work.

    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)


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Saturday, October 24, 2026 11:53:05
    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.

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Nuno Silva@3:633/10 to All on Saturday, October 24, 2026 12:06:06
    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.

    --
    Nuno Silva

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Kenny McCormack@3:633/10 to All on Saturday, October 24, 2026 12:10:39
    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.

    --
    Rich people pay Fox people to convince middle class people to blame poor people.

    (John Fugelsang)

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From StĂ©phane CARPENTIER@3:633/10 to All on Saturday, October 24, 2026 13:41:20
    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 last one is the shell you choose to write your scripts. It doesn't
    need to be the same one than the one you are using to interact with your
    shell. As long as the shebang is correctly defined, it depends more on
    the people with whom you share it than with any default choice made by
    any distro. Because people can be more or less comfortable with
    different specificities, even if they can install any available shell.

    Unlike the choice of the default bootloader or the choice of the default
    init system can can have huge impacts, I really don't see how the choice
    of the default shell by a distro can be important (for the end user
    because for the contributor, it has some implications).

    --
    Si vous avez du temps … perdre :
    https://scarpet42.gitlab.io

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Saturday, October 24, 2026 18:53:40
    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.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Carlos E.R.@3:633/10 to All on Saturday, October 24, 2026 21:31:08
    On 2026-10-24 15:41, St‚phane CARPENTIER wrote:
    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.

    I don't see any reason to change the shell used by system scripts. If
    the shebang is /bin/sh, and bad things happen if you uninstall bash and
    they are forced to use ksh, well, it is their fault and it is a bug.
    They should have specified the proper shebang. Just report it.

    --
    Cheers, Carlos.
    ES??, EU??;

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Saturday, October 24, 2026 22:36:52
    On 24 Oct 2026 13:41:20 GMT, St‚phane CARPENTIER wrote:

    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.

    Debian (and I guess its derivatives as well) long ago moved away from
    the assumption that ?/bin/sh? meant the same thing as ?/bin/bash?.
    They introduced a new, very vanilla, POSIX-compliant shell called
    dash(1) <https://manpages.debian.org/dash(1)>, which is the shell that
    is invoked when your script says ?/bin/sh?.

    So if you want bash, you have to explicitly ask for bash.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Sunday, October 25, 2026 23:49:28
    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' :-)


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Sunday, October 25, 2026 23:59:11
    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.

    "Needs" eventually rule. So, EVERYONE winds up with kind
    of the same 'capabilities'. How nice/easy/clear, depends.

    Use Python for scripts over maybe 10 lines for everything
    these days. Infinitely capable and READABLE and DOCUMENTED.
    No real competition now. If you hate Python "just because"
    then reconsider.

    Yea yea ... the old shells are "Trad-IX" ... but IMHO
    their day is kinda OVER.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Monday, October 26, 2026 00:28:00
    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.

    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.

    "AI"s aren't really as all-around 'smart' as their
    sellers suggest :-)

    You generally find that out AFTER you $ubscribe .....


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Monday, October 26, 2026 00:57:26
    On 10/24/26 08: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.

    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.

    I've mentioned (necessary) "Functional Convergence". If yer
    shell doesn't do something neat-o some other one does NOW,
    it WILL soon enough. Might get squeezed-in nice/neat, or
    maybe NOT. All great/pure ideas/visions eventually HAVE to
    converge somewhere - or vanish into the historical recycle bin.

    Anyway, for 'scripts', I'm 99% Python now. Does EVERYTHING
    and MUCH clearer than any old shell.

    Of note, did NOT use Python until P3 came out. It seemed
    interesting/versatile but why learn an obsolete version ?
    BASIC, skip the bile, became a fair 'script' lang after
    awhile - but, too clunky IMHO - meant for a different
    era, different environment, different mindset.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Monday, October 26, 2026 06:04:59
    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' :-)



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Monday, October 26, 2026 06:20:48
    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.)

    Janis

    [...]

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Monday, October 26, 2026 06:41:38
    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.

    Janis

    [...]

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Monday, October 26, 2026 03:15:57
    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 ...


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Monday, October 26, 2026 03:38:31
    On 10/26/26 01:20, Janis Papanagnou wrote:
    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.

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

    Oh, in my previous reply I said something like that; that it's
    fine if it serves you in your private contexts.

    Most everybody has a 'private context'. Doesn't
    matter what you do in 'IT'. Every life experience
    and need is a bit different, takes you down
    different paths. Since the 70s the field was
    SO wide that nobody could do it ALL, keep it
    ALL in mind.

    DID like that newfangled 'C' language for
    the PDPs though :-)

    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.

    Been there.

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

    Still a lot of 'religion' involved ... some present
    THE Way ... holy writ. Rarely works for most.

    Yea, there are maybe a few IQ-200 people who post.
    Well, good for them. we need some IQ-200 people.
    However even they have their prejudices and
    preferences that may not serve all. It's the
    tendency for ATTITUDE that most annoys me. Not
    looking for an Ayatollah.

    Ever see that "Sheldon" character from the TV series ?
    HIS way or you get the "retard" label :-)

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

    Very much noted.

    But, bigger picture, I think that's *wrong*.

    MANY paths to "your solution". Pick the best
    and most compatible. SO many paths to be had
    these days. Be smart and sensible. Simpler
    TENDS to be better long-term.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Monday, October 26, 2026 03:50:22
    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 ???


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Keith Thompson@3:633/10 to All on Monday, October 26, 2026 15:16:29
    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.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Tuesday, October 27, 2026 02:26:27
    On 2026-10-26 23:16, Keith Thompson wrote:
    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).

    (It was not so much a challenge but a motivation to think about it.)

    I trap on SIGWINCH.

    That's a reasonable alternative for that specific task.

    I thought it was an appropriate example because Kornshell's "Discipline Functions" are of course not only applicable to this specific variable
    but to every variable, also user defined.[*] Actually you can associate
    such functions, and not only the predefined 'get', 'set', and 'unset',
    but also user defined, to any shell variables, existing and introduced.
    It was a compact example that stems from a real application not just an academical one, and it was also compact enough to not get distracted.
    It should make it more obvious what simple syntactic features and their differences in the shells are and where there's a more tight embedding
    with the shell mechanisms and features existing. As it was a simple
    example to think about I also not really wanted to see a Bash solution,
    I know a solution[**] which in the light of that feature I can only call
    a workaround, though.

    Above sample line contain also another Kornshell specific feature; use
    of namespaces. Just BTW. (There's still quite a lot unique features in Kornshell.)

    Janis

    [*] It goes further, being able to associate functions to "Types" with
    'typeset -T', making code organizations possible that some call "object oriented".

    [**] Actually, there had been a neat idea in the past; Kaz suggested and developed a shell status line feature for Bash (called "basta"). Since
    it was for Bash it had to handle window resizing by another way. I just
    adopted the idea of the tool and implemented my version for Kornshell
    (called "kosta", to honor the origin of the basic idea) from scratch,
    and of course I could make use of such Kornshell-features to simplify
    the code.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Tuesday, October 27, 2026 02:44:31
    On 2026-10-26 08:50, c186282 wrote:
    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.

    (Hmm.. - are these comments probably what Kenny previously had meant
    when he spoke about trollish behavior. - Beyond that I don't see how
    these statements would contribute anything substantial.)

    (We seem to also have different interpretations of the meaning of the
    word "standard".)


    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˙ :-)

    Sure, you said that before that this is (one of) your preference(s).

    (Mind that I was making a comment, backed up with an actual example,
    to explain why I said your generalizing statements are inappropriate
    and even wrong, concerning major features in Ksh vs. Bash.)


    ˙ 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 ???

    Nothing I showed in my sample was "reinventing the wheel". It may not
    have become obvious to you by the sample, despite having deliberately
    kept it terse and focused. The previous discussions was about features,
    simple ones - you basically implied that all features are trivial and
    mapable - and ones that are substantially extending the shell language
    - where I provided an example for better understanding the differences.

    Nevermind.

    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Tuesday, October 27, 2026 04:42:56
    On 2026-10-26 08:15, c186282 wrote:
    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.

    I can't see how that would match to what had previously been discussed.

    First, I think, we should acknowledge a few facts for better valuation. Kornshell (ksh88) was the base for the POSIX standard (not "standard").
    Bash (and Zsh) support that standard. All these three shells extended
    their set of features according to the needs and course of evolution.
    Zsh made some fundamental additions in some features to tackle inherent
    issues in Bourne shell. Ksh and Bash kept Bourne shell's basic syntax.
    Ksh extended (and streamlined some) features staying withing Bourne's syntactical paragon (as far as sensible and possible).

    So it came that Ksh featured, for example, things like ${..//../..}, ${..:..:..}, ((...)), <(...), "ksh-patterns", and many more features
    that Bash (and Zsh) adopted.

    Many more features either weren't (yet) adopted, things like 'float'
    arithmetic and more basic math functions in $((...)) and ((...)),
    namespaces, type system, discipline functions, and whatnot.

    I would have hoped that some features would not have been implemented
    in Bash by other names, using other built-in command's options, and
    that the rest would have converged better and faster; mind that many
    of the newer Ksh features have already been available with Ksh in '93.


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

    Maybe, maybe not. - But what strikes me more is that (shell-)languages
    might vanish because of other factors; like official maintenance and
    support. I think with the predominance of Bash it will likely persist,
    but I'm not that sure with Ksh; after official support from AT&T was
    dropped we have to rely on those that took over the task today. Since
    the Ksh is less widely used (and the maintainers struggling with the
    code base, at least as it seems to me) I'm not too optimistic here.

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

    *shrug*

    My experience here is that you can do a lot to address that, so the
    adverbs you use are relative to one's experience and programming
    habits.

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

    As said, as lot is in the hand of the programmer. (You may be doomed
    if you want to work on third-party code. But if your own code is that
    bad that you can't "decipher" it after a year don't blame the language
    alone.)

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

    So I understood correctly, fine.

    I maintain my philosophy to not store any of my sensible data in "the
    cloud", neither in plain nor in encrypted form. An encryption that is
    safe today isn't guaranteed to be safe tomorrow. Since if my data is
    accessible by some third party in the cloud _now_ it might get decoded
    later; so that's no option for my.

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

    (In my previous post I wrote that I'm not the appropriate person to
    discuss Python.)

    I just said that I understand that because you obviously show some,
    umm.., enthusiasm here, concerning that specific language.

    (I heard and read about Python, I helped debugging a piece of Python
    that my child was trying to run, and I draw the conclusion that it's
    not worth [for me] to learn and use that language.)

    (It certainly appears a lot more "attractive" than the Unix shells.
    But enthusiastic comments often disregard other aspects. Standard
    environments and tools, company policies, etc., so in your private
    system environment you have more options to choose your personally
    preferred tools.)


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

    (I already commented on that.)

    Doing serious string stuff in
    ˙ BASH and several others ... nasty !

    I'm curious what specifically you mean; can you give examples?


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

    Well, your way of writing programs may differ from mine.

    And (given what you wrote) I'm likely about as old as you are;
    and I'm certainly not "remembering" what an older program does.
    I'm certainly writing my programs in ways that makes it possible
    to resume work at a later stage. This is actually not uncommon;
    I've done it in various languages, and problems arose primarily
    where I ignored (general, or my own) program quality standards.

    I mean I've seen bad code in many languages. And I consider it a
    basic programming skill to structure code, name entities sensibly,
    and comment code, as necessary.

    I understand that the shell with its attributes of being somewhat
    cryptic you may more easily write "messy" code, and that it needs
    experience and more discipline to write maintainable software.[*]

    [*] Back in the 1990's when I gave a couple courses in Kornshell
    I explicitly emphasized to handle the Shell not as a "scripting
    language" but as a _programming language_. (Hope you understand
    what I'm trying to say by that.) To apply all the good practices
    that you also apply with other non-"scripting"-languages.


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

    (I already asked above about any concrete example you have in mind.)

    [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 ???

    Here we spoke not about "defaulting"[*]; here we spoke about
    explicitly "intentionally installed" shells.

    Over the time I've used several. Around Y2k I had Suse which had a
    PD-ksh. Currently I have Xubuntu which comes with ksh93u+m. But of
    course you can also make another shell your personal default-shell;
    there's really a lot of shells you can choose from (on Linuxes).

    [*] Concerning to your term "'ksh'-defaulting" I refer to another
    post in this thread who already expanded on that. (I don't want to
    engage with you in some terminology-battle, whether that is your
    intention or not.)[**]

    [**] Concerning "default" shell we already exchanged this:
    |
    | 24-10-2026, Janis Papanagnou:
    | > 2026-10-24, c186282:
    | >> Note however that MOST distros default to BASH now -
    | >
    | > Yes, Linux often has Bash as its default.
    |
    and with a seemingly agreed interpretation of "default" we seem to
    have said the same, so I don't think there's more to say.

    [snip]
    [...]

    ˙ Never got TOO far into ZSH ... but it DOES have a lot
    ˙ of potential. Don't count it out of the picture.

    (I certainly don't ignore Zsh, I even mentioned it a couple times.)

    [big snip of digressions]
    Janis


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Janis Papanagnou@3:633/10 to All on Tuesday, October 27, 2026 05:01:49
    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.


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Tuesday, October 27, 2026 12:24:16
    On 10/27/26 00:01, Janis Papanagnou wrote:
    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)...

    Well, a lot of re-sorting at the very least.

    Punch cards and paper tape WORKED. Clunky and
    low-density but they worked - and were used
    for quite awhile. However putting a COBOL
    corporate accounting system on cards is
    not an attractive prospect.

    I've run into people who remember those
    mag tape towers from old movies and think
    the programs/data was just magically
    uploaded directly to them. Nope, paper
    cards first .....

    Found a PDP-11 emulator for Linux, but it
    just wouldn't be quite the same. MAY be
    some actual working units still out there
    however. Weak unit by today's standards,
    but at the time it was pretty good.

    ˙˙ Helped a bit if you offered them 'gifts'.

    ...and corrupted people?

    People are mostly pre-corrupted :-)

    The SysLord had a serial terminal, but all
    the rest of us had to do cards.

    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.

    Admit it, was a CLEVER joke !

    SADAT ... do, but barely, remember it now.

    The dictator, well, things didn't work out so
    well for him :-)


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)