• Extensions in shells

    From Johann 'Myrkraverk' Oskarsson@johann@myrkraverk.invalid to comp.unix.shell on Sat Jul 25 01:03:33 2026
    From Newsgroup: comp.unix.shell

    On 24/07/2026 8:34 PM, Janis Papanagnou wrote:

    Historically it was typical to have the specific tasks separated...

    Like, "echo", "ls", ..., don't actually do enough to justify the
    overhead of spawning a new process.

    ...where newer shells typically have made sensible decisions and built
    in functions like 'echo' and 'printf', and added syntactic constructs,
    like '[[...]]' that made the former external '[' command (meanwhile
    often also built-in) unnecessary.

    Concerning 'ls', I don't think that this is primitive enough to become
    a built-in; inspect the many options you typically get with it, even
    if you only restrict to the POSIX subset. (And for shell scripting you
    often don't even need 'ls' since filenames are typically obtained by
    other ways and can be obtained even by wildcards in any context.)

    (What I'm actually missing is a shell built-in 'stat' command; I think
    that would be sensible. But that's just my personal opinion.)


    This is trivial, for some value of trivial, by making a Zsh extension.

    I've previously written one in C -- of course -- but now the code is
    lost. What I did for fun was to create a binding for OpenGL. It was
    enough to show a triangle on a screen. Today, I'd probably do the same
    via SDL3, or even SDL2, and OpenGL rather than GLUT.


    And by now, it seems I snipped the part where you mentioned ksh. Does
    ksh also have a mechanism for dynamic modules?
    --
    Johann | email: invalid -> com | www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | twitter: @myrkraverk
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Janis Papanagnou@janis_papanagnou+ng@hotmail.com to comp.unix.shell on Fri Jul 24 23:33:43 2026
    From Newsgroup: comp.unix.shell

    On 2026-07-24 19:03, Johann 'Myrkraverk' Oskarsson wrote:
    On 24/07/2026 8:34 PM, Janis Papanagnou wrote:

    Historically it was typical to have the specific tasks separated...

    Like, "echo", "ls", ..., don't actually do enough to justify the
    overhead of spawning a new process.

    ...where newer shells typically have made sensible decisions and built
    in functions like 'echo' and 'printf', and added syntactic constructs,
    like '[[...]]' that made the former external '[' command (meanwhile
    often also built-in) unnecessary.

    Concerning 'ls', I don't think that this is primitive enough to become
    a built-in; inspect the many options you typically get with it, even
    if you only restrict to the POSIX subset. (And for shell scripting you
    often don't even need 'ls' since filenames are typically obtained by
    other ways and can be obtained even by wildcards in any context.)

    (What I'm actually missing is a shell built-in 'stat' command; I think
    that would be sensible. But that's just my personal opinion.)


    This is trivial, for some value of trivial, by making a Zsh extension.

    I've previously written one in C -- of course -- but now the code is
    lost.-a What I did for fun was to create a binding for OpenGL.-a It was enough to show a triangle on a screen.-a Today, I'd probably do the same
    via SDL3, or even SDL2, and OpenGL rather than GLUT.


    And by now, it seems I snipped the part where you mentioned ksh.-a Does
    ksh also have a mechanism for dynamic modules?

    You can for example write a C-function and load it from Kornshell using
    the 'builtin' command.

    NAME
    builtin - add, delete, or display shell built-ins

    SYNOPSIS
    builtin [ options ] [pathname ...]

    DESCRIPTION
    builtin can be used to add, delete, or display built-in commands in
    the current shell environment. A built-in command executes in the
    current shell process and can have side effects in the current shell.
    On most systems, the invocation time for built-in commands is one or
    two orders of magnitude less than commands that create a separate
    process.

    For each pathname specified, the basename of the pathname determines
    the name of the built-in. For each basename, the shell looks for a C
    level function in the current shell whose name is determined by
    prepending b_ to the built-in name. If pathname contains a /, then
    the built-in is bound to this pathname. A built-in bound to a
    pathname will only be executed if pathname is the first executable
    found during a path search. Otherwise, built-ins are found prior to
    performing the path search.

    If no pathname operands are specified, then builtin displays the
    current list of built-ins, or just the special built-ins if -s is
    specified, on standard output. The full pathname for built-ins that
    are bound to pathnames are displayed.

    builtin cannot be invoked from a restricted shell.



    I've played with Kornshell built-ins in the past. And it may be useful.

    But doing a quick test with my old code strangely fails with ksh93u+m,
    I get: "builtin: adding built-ins not supported"! - WTF?
    Obviously some things have changed in Martijn Dekker's ksh version. A
    quick test of 'builtin' with AT&T ksh93u+ is still working, though.[*]
    But Martijn Dekker's ksh93u+m version's 'builtin' man-page (sadly) says
    -f lib Not supported.
    -l No effect.
    where AT&T's ksh93u+ documents verbosely
    -f lib On systems with dynamic linking, lib names a shared
    library to load and search for built-ins. Libraries
    are searched for in ../lib/ksh and ../lib on $PATH
    and in system dependent library directories. The
    system dependent shared library prefix and/or
    suffix may be omitted. Once a library is loaded,
    its symbols become available for the current and
    subsequent invocations of builtin. Multiple
    libraries can be specified with separate
    invocations of builtin. Libraries are searched in
    the reverse order in which they are specified.
    -l List the library base name, plugin YYYYMMDD version
    stamp, and full path for -flib on one line on the


    The point of the statement in my post (seeking for a builtin 'stat')
    was the wish to have it available natively as built-in. The reason is
    that I prefer the standard environments of tools and avoid personal or proprietary additions.

    Concerning 'stat' I typically have also no performance requirements on
    that command, so it's more like a nice-to-have than a strong demand.

    Janis

    [*] In the past I had suggested to prefer ksh93u+m over ksh93u+, but
    meanwhile I'm not that sure any more; there's quite some ksh features
    that I had used in the past not any more supported by Martijn's branch.
    :-(

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.unix.shell on Sat Jul 25 02:25:05 2026
    From Newsgroup: comp.unix.shell

    On Sat, 25 Jul 2026 01:03:33 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    This is trivial, for some value of trivial, by making a Zsh
    extension.

    Many apps that allow addons/plugins are moving away from allowing
    third-party code to execute within their process context. Instead, the addon/plugin executes in its own process, with communication with the
    parent app handled via an IPC protocol buried within an API library of
    some sort.

    Examples: GIMP, Inkscape.

    A shell could provide something similar -- if it wants third-party
    code messing with its internal context. Otherwise I would avoid it.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Johann 'Myrkraverk' Oskarsson@johann@myrkraverk.invalid to comp.unix.shell on Sat Jul 25 18:07:02 2026
    From Newsgroup: comp.unix.shell

    On 25/07/2026 10:25 AM, Lawrence DrCOOliveiro wrote:
    On Sat, 25 Jul 2026 01:03:33 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    This is trivial, for some value of trivial, by making a Zsh
    extension.

    Many apps that allow addons/plugins are moving away from allowing
    third-party code to execute within their process context. Instead, the addon/plugin executes in its own process, with communication with the
    parent app handled via an IPC protocol buried within an API library of
    some sort.

    Examples: GIMP, Inkscape.

    A shell could provide something similar -- if it wants third-party
    code messing with its internal context. Otherwise I would avoid it.

    Zsh has a well established set of extensions. For example, there's
    the /stat/ system call we were previously talking about, though I was originally thinking of /ls/ as an extension to build in C.


    https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-zsh_002fstat-Module

    On the graphics front, I've moved away from GIMP and Inkscape, and
    now use CorelDRAW and Photo-Paint. As far as I can tell, they still
    offer direct binary plugins. I'll quote their manual.

    Solutions based on VBA Macros, VSTA plugins and C++ plugins all run in
    the context of the host applications such as CorelDRAW, Corel PHOTO-
    PAINT, Corel DESIGNER.

    If you absolutely need open source tools, CinePaint is still on life
    support, and I doubt they've removed the binary plugin feature.

    http://cinepaint.org/


    Happy drawing!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.unix.shell on Sat Jul 25 22:39:24 2026
    From Newsgroup: comp.unix.shell

    On Sat, 25 Jul 2026 18:07:02 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    On the graphics front, I've moved away from GIMP and Inkscape, and
    now use CorelDRAW and Photo-Paint.

    You enjoy getting locked into rentware, do you?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Johann 'Myrkraverk' Oskarsson@johann@myrkraverk.invalid to comp.unix.shell on Mon Jul 27 00:31:42 2026
    From Newsgroup: comp.unix.shell

    On 26/07/2026 6:39 AM, Lawrence DrCOOliveiro wrote:
    On Sat, 25 Jul 2026 18:07:02 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    On the graphics front, I've moved away from GIMP and Inkscape, and
    now use CorelDRAW and Photo-Paint.

    You enjoy getting locked into rentware, do you?

    What did you do? Why did you /rent/ CorelDRAW? Did you not notice
    that before the checkout, you can choose the /CorelDRAW Graphics Suite
    2026/ as a one time purchase for $859? There are cheaper options, and
    I even found new copies of older versions for much less on Ebay. I
    just use 2021, which doesn't have any of the AI features; or none that
    I noticed.

    Well, whatever, done is done, and I wish you happy graphics design with
    your rental copy!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.unix.shell on Sun Jul 26 22:56:52 2026
    From Newsgroup: comp.unix.shell

    On Mon, 27 Jul 2026 00:31:42 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    I just use 2021, which doesn't have any of the AI features; or none
    that I noticed.

    Would you entrust mission-critical business operations to obsolete,
    unsupported software?

    Did you not notice that before the checkout, you can choose the
    /CorelDRAW Graphics Suite 2026/ as a one time purchase for $859?

    ThatrCOs quite expensive, if itrCOs just a hobby ...
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Nuno Silva@nunojsilva@invalid.invalid to comp.unix.shell on Mon Jul 27 08:41:34 2026
    From Newsgroup: comp.unix.shell

    On 2026-07-26, Lawrence DrCOOliveiro wrote:

    On Mon, 27 Jul 2026 00:31:42 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    I just use 2021, which doesn't have any of the AI features; or none
    that I noticed.

    Would you entrust mission-critical business operations to obsolete, unsupported software?

    Yes. What's the question there, if it works for what is needed and does
    not change, it's already better than something which may actively
    change.

    It's called stability. Although, yes, it can be supported and stable
    (see e.g. Debian). But if one thing works, and the environment can
    continue running it, then there's really not much of a reason to upgrade
    just because it's out of official support.

    Things like this almost sound like the software houses are going to
    provide a lot of support or fixes to users even when still in
    support. Is that even a common thing?

    Did you not notice that before the checkout, you can choose the
    /CorelDRAW Graphics Suite 2026/ as a one time purchase for $859?

    ThatrCOs quite expensive, if itrCOs just a hobby ...

    Stop moving goalposts, Lawrence. They've just said they use 2021
    themselves, might even be because of the price tag! The 2026 comment is
    because somebody claimed it's only available in a subscription
    model. Now, who was that somebody...
    --
    Nuno Silva
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Johann 'Myrkraverk' Oskarsson@johann@myrkraverk.invalid to comp.unix.shell on Tue Jul 28 02:42:38 2026
    From Newsgroup: comp.unix.shell

    On 27/07/2026 3:41 PM, Nuno Silva wrote:
    On 2026-07-26, Lawrence DrCOOliveiro wrote:

    On Mon, 27 Jul 2026 00:31:42 +0800, Johann 'Myrkraverk' Oskarsson wrote:


    Did you not notice that before the checkout, you can choose the
    /CorelDRAW Graphics Suite 2026/ as a one time purchase for $859?

    ThatrCOs quite expensive, if itrCOs just a hobby ...

    Stop moving goalposts, Lawrence. They've just said they use 2021
    themselves, might even be because of the price tag! The 2026 comment is because somebody claimed it's only available in a subscription
    model. Now, who was that somebody...


    Yes, let's stick to shells. I attempted to build ksh93u+m on MSYS,
    and I ran into several problems. I've fixed two, by editing the
    bin/package script. One problem was checking for the executable bit
    of bin/package itself. I changed that to test -f instead. That won't
    make it upstream unchanged, but the goal here is to build it first,
    patch later.

    The second problem is using the "full path" to the compiler. It finds
    cc or gcc in /bin, and hard-codes /bin/cc or /bin/gcc depending on
    whether I set CC=gcc or leave it out. When it does that, GCC can't
    execute cc1.exe. I found the first instance where $cc is set -- note
    the lowercase -- and hard-patched that to be /usr/bin/gcc instead.

    The third problem was something to do with CYGWIN not being set to
    ntsec. I have no idea what that's about, but now I run it as

    CYGWIN=ntsec bin/package make

    and it fails for the fourth time, again not finding cc1.exe. I haven't
    yet patched that.


    If all of that works out, I may just look at the dynamic builtin feature
    and see if OpenGL bindings make sense for ksh93. David Korn just might
    port DOOM!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.unix.shell on Mon Jul 27 23:10:26 2026
    From Newsgroup: comp.unix.shell

    On Tue, 28 Jul 2026 02:42:38 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    On Sun, 26 Jul 2026 22:56:52 -0000 (UTC), Lawrence DrCOOliveiro wrote:

    On Mon, 27 Jul 2026 00:31:42 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    I just use 2021, which doesn't have any of the AI features; or none
    that I noticed.

    Would you entrust mission-critical business operations to obsolete,
    unsupported software?

    Did you not notice that before the checkout, you can choose the
    /CorelDRAW Graphics Suite 2026/ as a one time purchase for $859?

    ThatrCOs quite expensive, if itrCOs just a hobby ...

    Yes, let's stick to shells.

    It always amuses me to see the lengths to which those caught in the proprietary-software trap go out of their way to deny that they are in
    any way trapped ...
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Johann 'Myrkraverk' Oskarsson@johann@myrkraverk.invalid to comp.unix.shell,alt.ascii-art on Tue Jul 28 19:45:58 2026
    From Newsgroup: comp.unix.shell

    On 28/07/2026 7:10 AM, Lawrence DrCOOliveiro wrote:
    On Tue, 28 Jul 2026 02:42:38 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    On Sun, 26 Jul 2026 22:56:52 -0000 (UTC), Lawrence DrCOOliveiro wrote:

    On Mon, 27 Jul 2026 00:31:42 +0800, Johann 'Myrkraverk' Oskarsson wrote: >>>
    I just use 2021, which doesn't have any of the AI features; or none
    that I noticed.

    Would you entrust mission-critical business operations to obsolete,
    unsupported software?

    Did you not notice that before the checkout, you can choose the
    /CorelDRAW Graphics Suite 2026/ as a one time purchase for $859?

    ThatrCOs quite expensive, if itrCOs just a hobby ...

    Yes, let's stick to shells.

    It always amuses me to see the lengths to which those caught in the proprietary-software trap go out of their way to deny that they are in
    any way trapped ...

    I don't see any obvious trap in

    88888888888888888888888888888888888888888888888888888888888888888888888
    88.._| | `-. | `. -_-_ _-_ _- _- -_ - .'| |.'| | _..88
    88 `-.._ | |`! |`. -_ -__ -_ _- _-_- .' |.;' | _.!-'| 88
    88 | `-!._ | `;! ;. _______________ ,'| .-' | _!.i' | 88
    88..__ | |`-!._ | `.| |_______________||."'| _!.;' | _|..88
    88 |``"..__ | |`";.| i|_|MMMMMMMMMMM|_|'| _!-| | _|..-|' 88
    88 | |``--..|_ | `;!|l|MMoMMMMoMMM|1|.'j |_..!-'| | 88
    88 | | | |`-,!_|_|MMMMP'YMMMM|_||.!-;' | | | 88 88___|______|____!.,.!,.!,!|d|MMMo * loMM|p|,!,.!.,.!..__|_____|_____88
    88 | | | | | |_|MMMMb,dMMMM|_|| | | | | | 88
    88 | | |..!-;'i|r|MPYMoMMMMoM|r| |`-..| | | | 88
    88 | _!.-j' | _!,"|_|M<>MMMMoMMM|_||!._| `i-!.._ | | 88
    88 _!.-'| | _."| !;|1|MbdMMoMMMMM|l|`.| `-._| |``-.._ | 88
    88..-i' | _.''| !-| !|_|MMMoMMMMoMM|_|.|`-. | ``._ | |``"..88
    88 | |.| |.| !| |u|MoMMMMoMMMM|n||`. |`! | `". | 88
    88 | _.-' | .' |.' |/|_|MMMMoMMMMoM|_|! |`! `,.| |-._| 88
    88 _!"'| !.'| .'| .'|[@]MMMMMMMMMMM[@] \| `. | `._ | `-._ 88
    88-' | .' |.| |/| / \|`. |`! |.| |`-88
    88 |_.'| .' | .' |/ \ \ | `. | `._-Lee| 88
    88 .' | .' |/| / \ |`! |`.| `. | 88
    88 _.' !'| .' | / \| ` | `. |`.| 88 88888888888888888888888888888888888888888888888888888888888888888888888

    do you read the "ldr1u@" and "1prln@" runes differently? Do you have
    stats in /detect traps/? Do you suppose these runes are C tokens? per-
    haps from tcsh?

    Did you know you can find my name in the list of contributors in the
    tcsh sources? Did I just walk you into a trap, where you thought I
    only used "proprietary software" with my name already in the list of
    tcsh sources?

    How do you like tcsh? I think it's a really neat shell for interactive
    use!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com

    P.S. Picture not mine. Taken from the alt.ascii-art yearly FAQ.
    Can you guess the artist's name?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.unix.shell on Tue Jul 28 22:31:25 2026
    From Newsgroup: comp.unix.shell

    On Tue, 28 Jul 2026 19:45:58 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    On 28/07/2026 7:10 AM, Lawrence DrCOOliveiro wrote:

    On Tue, 28 Jul 2026 02:42:38 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    On Sun, 26 Jul 2026 22:56:52 -0000 (UTC), Lawrence DrCOOliveiro wrote:

    On Mon, 27 Jul 2026 00:31:42 +0800, Johann 'Myrkraverk' Oskarsson wrote: >>>>
    I just use 2021, which doesn't have any of the AI features; or none
    that I noticed.

    Would you entrust mission-critical business operations to
    obsolete, unsupported software?

    Did you not notice that before the checkout, you can choose the
    /CorelDRAW Graphics Suite 2026/ as a one time purchase for $859?

    ThatrCOs quite expensive, if itrCOs just a hobby ...

    Yes, let's stick to shells.

    It always amuses me to see the lengths to which those caught in the
    proprietary-software trap go out of their way to deny that they are
    in any way trapped ...

    I don't see any obvious trap in ...

    Having all your hard work locked in a proprietary data format
    controlled by a corporation that doesnrCOt have your interests at heart?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Johann 'Myrkraverk' Oskarsson@johann@myrkraverk.invalid to comp.unix.shell on Wed Aug 5 19:24:19 2026
    From Newsgroup: comp.unix.shell

    On 29/07/2026 6:31 AM, Lawrence DrCOOliveiro wrote:
    On Tue, 28 Jul 2026 19:45:58 +0800, Johann 'Myrkraverk' Oskarsson wrote:

    On 28/07/2026 7:10 AM, Lawrence DrCOOliveiro wrote:

    On Tue, 28 Jul 2026 02:42:38 +0800, Johann 'Myrkraverk' Oskarsson wrote: >>>
    On Sun, 26 Jul 2026 22:56:52 -0000 (UTC), Lawrence DrCOOliveiro wrote: >>>>>
    On Mon, 27 Jul 2026 00:31:42 +0800, Johann 'Myrkraverk' Oskarsson wrote: >>>>>
    I just use 2021, which doesn't have any of the AI features; or none >>>>>> that I noticed.

    Would you entrust mission-critical business operations to
    obsolete, unsupported software?

    Did you not notice that before the checkout, you can choose the
    /CorelDRAW Graphics Suite 2026/ as a one time purchase for $859?

    ThatrCOs quite expensive, if itrCOs just a hobby ...

    Yes, let's stick to shells.

    It always amuses me to see the lengths to which those caught in the
    proprietary-software trap go out of their way to deny that they are
    in any way trapped ...

    I don't see any obvious trap in ...

    Having all your hard work locked in a proprietary data format
    controlled by a corporation that doesnrCOt have your interests at heart?

    What did you do Lawrence? Did you just spend USD 7,833.00 on a brand
    new license from SCO, just to get a proprietary Unix shell?

    https://www.ebay.com/itm/134643459239

    Isn't that spending too much? Do you have gambling problems too? Does Grosvenor Casino in London know about it?


    Best wishes, and I hope you settle your gambling debts some day!
    --
    Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | via Easynews.com https://bsky.app/profile/myrkraverk.bsky.social
    --- Synchronet 3.22a-Linux NewsLink 1.2