• gawk on Windows

    From Igenlode Wordsmith@21:1/5 to All on Mon Jul 25 07:00:03 2022
    I've been trying to share a gawk script for doing some processing on a
    Web page with a friend - it is theoretically cross-platform portable,
    but she runs Windows and I don't. (I don't even know which version of
    Windows she has; presumably the latest, whichever that is?)

    She is having trouble in installing gawk on her computer. It looks as if
    she needs to download GnuWin32 (or Cygwin?), but the downloads linked at https://downloads.sourceforge.net/project/gnuwin32/gawk/3.1.6-1/gawk-3.1.6-1-setup.exe
    and
    https://downloads.sourceforge.net/project/ezwinports/gdb-12.1-w32-bin.zip simply fail (and failed for me too when I tested them).

    How does one set about running gawk under Windows nowadays? All the
    references at http://gnuwin32.sourceforge.net/install.html look
    worryingly ancient, and I know next to nothing about Windows software installation myself, while she is a self-admitted 'tech novice'.

    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    * Usenet: Warning, may contain Nuts *

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mack The Knife@21:1/5 to Use-Author-Supplied-Address-Header@ on Mon Jul 25 07:00:27 2022
    The gnuwin32 version of gawk is ancient. Don't use it. Use the version
    from ezwinports, which is what's supported under Windows by the GNU
    developers.

    This is corroborated by the gawk manual. See: https://www.gnu.org/software/gawk/manual/html_node/PC-Binary-Installation.html

    Cygwin is an alternative; it provides the possibility of a POSIX-style environment under Windows, including gawk, but is probably more than
    you want.

    HTH,

    Mack The Knife

    In article <20220725060702.AA9491200D9@fleegle.mixmin.net>,
    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:
    I've been trying to share a gawk script for doing some processing on a
    Web page with a friend - it is theoretically cross-platform portable,
    but she runs Windows and I don't. (I don't even know which version of
    Windows she has; presumably the latest, whichever that is?)

    She is having trouble in installing gawk on her computer. It looks as if
    she needs to download GnuWin32 (or Cygwin?), but the downloads linked at >https://downloads.sourceforge.net/project/gnuwin32/gawk/3.1.6-1/gawk-3.1.6-1-setup.exe
    and
    https://downloads.sourceforge.net/project/ezwinports/gdb-12.1-w32-bin.zip >simply fail (and failed for me too when I tested them).

    How does one set about running gawk under Windows nowadays? All the >references at http://gnuwin32.sourceforge.net/install.html look
    worryingly ancient, and I know next to nothing about Windows software >installation myself, while she is a self-admitted 'tech novice'.

    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    * Usenet: Warning, may contain Nuts *

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Igenlode Wordsmith on Mon Jul 25 08:11:11 2022
    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> writes:
    How does one set about running gawk under Windows nowadays?

    Sorry for being vague, but it's a long time ago I did this:

    The last time I did this, I used a Web search engine to find
    ports of GNU tools to Windows. I found several different
    collections based on different libraries, for example some
    might have used Cygwin DLLs others not. I tried several
    collections and then chose one that worked or worked best.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to Use-Author-Supplied-Address-Header@ on Mon Jul 25 09:45:16 2022
    In article <20220725060702.AA9491200D9@fleegle.mixmin.net>,
    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:
    ...
    How does one set about running gawk under Windows nowadays?

    I recommend Cygwin, for a variety of reasons.

    But you don't need to install all of Cygwin on the target machine. What I
    do is to install Cygwin on my machine (actually, a Windows VM running under Linux), so that I have access to all of the bells and whistles of Cygwin,
    but for the target machine, I just figure out what I need to put on their machine.

    $ ldd gawk

    will tell you which DLLs you need. I think it boils down to just:

    1) gawk.exe
    2) cygwin1.dll
    3) cyggmp-10.dll
    4) cygintl-8.dll
    5) cygmpfr-6.dll
    6) cygreadline7.dll
    7) cygsigsegv-2.dll

    Put all these files in a directory on the target machine that is in %PATH% (Windows-speak) and it should "just work".

    Now, I get that the undertone of this thread is that OP doesn't use Windows
    on a day-to-day basis, which is understandable, but it would behoove him to
    get some kind of Windows system going (like in a VM, as I do) or else it is just going to be very difficult to get the remote user up and running.

    --
    The randomly chosen signature file that would have appeared here is more than 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/ModernXtian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Kenny McCormack on Mon Jul 25 13:56:50 2022
    On 2022-07-25, Kenny McCormack <gazelle@shell.xmission.com> wrote:
    In article <20220725060702.AA9491200D9@fleegle.mixmin.net>,
    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:
    ...
    How does one set about running gawk under Windows nowadays?

    I recommend Cygwin, for a variety of reasons.

    But you don't need to install all of Cygwin on the target machine. What I
    do is to install Cygwin on my machine (actually, a Windows VM running under Linux), so that I have access to all of the bells and whistles of Cygwin,
    but for the target machine, I just figure out what I need to put on their machine.

    $ ldd gawk

    will tell you which DLLs you need. I think it boils down to just:

    1) gawk.exe
    2) cygwin1.dll
    3) cyggmp-10.dll
    4) cygintl-8.dll
    5) cygmpfr-6.dll
    6) cygreadline7.dll
    7) cygsigsegv-2.dll

    Speaking of which, I have been maintaining a project called Cygnal
    for the past six years. The output of the project is a forked
    cygwin1.dll that provides native-like behaviors.

    https://www.kylheku.com/cygnal/

    (I did try it Cygwin's Awk but not very extensively, and not recently.)

    Under Cygnal, windows paths with drive letters and all work.

    So does the "currently logged" drive concept; I made the otherwise POSIX chdir() function associate a current working directory with drives,
    so that accessing a file like "f:whatever.txt" could actually
    refer to "f:\users\bob\whatever.txt".

    Put all these files in a directory on the target machine that is in %PATH% (Windows-speak) and it should "just work".

    Speaking of PATH; Cygwin programs munge the PATH variable, turning it
    into colon-separated. This confuses native Windows subprocesses.

    In Cygnal, I fixed it; it uses the regular semicolon-separated PATH.
    The PATH-driven execution under execvp and whatnot follows that
    convention, and the rewriting of the environment variable is disabled.

    Also, the system() function uses cmd.exe. What's more, if something
    tries to exec "/bin/sh" "-c" "whatever", that gets rewritten to
    "cmd.exe" "/c" "whatever": so that programs which implement system-like functions using fork/exec or spawn aren't trying to execute a
    nonexistent command interpreter. (This won't fix an application which
    tries to execute a hard-coded Unix command, but it's useful for
    interpreters which provide access to the system's command interpreter.)

    So in theory, if you slide my cygwin1.dll under gawk.exe from Cygwin,
    you should be able to do something like system("echo %PATH%")
    or other Windows cmd.exe commands.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to 480-992-1380@kylheku.com on Mon Jul 25 14:47:21 2022
    In article <20220725064233.184@kylheku.com>,
    Kaz Kylheku <480-992-1380@kylheku.com> wrote:
    ...
    Also, the system() function uses cmd.exe. What's more, if something
    tries to exec "/bin/sh" "-c" "whatever", that gets rewritten to
    "cmd.exe" "/c" "whatever": so that programs which implement system-like >functions using fork/exec or spawn aren't trying to execute a
    nonexistent command interpreter.

    Is that such a good idea? What is I *DO* have Cygwin's /bin/sh on my
    system, and I *WANT* things to work like they do in Unix (e.g., I am using Cygwin to *COMPILE* GAWK (as I have done in the past) ?

    Surely, a blanket over-ride is heavy-handed...

    Anyway, that said, I do admire your concept of Cygnal. I haven't actually gotten around to trying it out yet, but will at some point.

    As I've mentioned a few times already, I don't do enough Windows stuff
    anymore to justify getting too involved in stuff like this.

    --
    Reading any post by Fred Hodgin, you're always faced with the choice of:
    lunatic, moron, or troll.

    I always try to be generous and give benefit of the doubt, by assuming troll.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stuart Ferguson@21:1/5 to Igenlode Wordsmith on Mon Jul 25 14:33:51 2022
    On Monday, 25 July 2022 at 07:07:04 UTC+1, Igenlode Wordsmith wrote:

    How does one set about running gawk under Windows nowadays?

    To use gawk on Windows with the minimum of fuss, try installing
    gawk using the Scoop package manager (https://scoop.sh/).

    Once you have scoop installed, which is a 5-minute job and requires
    no administrator rights, "scoop install gawk" will have you up and
    running straight away.

    It is useful, but not required, to create the directory C:\lib\awk
    to store gawk scripts, as this will be read as the default AWKPATH.

    I have no affiliation with Scoop, but have used it very successfully.
    At my place of work, the vast majority of people use Windows and
    have no command line experience. However, those same people use
    gawk applications at the PowerShell prompt with no problems.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to stuart.fergs@gmail.com on Mon Jul 25 21:46:58 2022
    In article <336969cb-bed0-4175-ab95-54c0c7f4a215n@googlegroups.com>,
    Stuart Ferguson <stuart.fergs@gmail.com> wrote:
    ...
    have no command line experience. However, those same people use
    gawk applications at the PowerShell prompt with no problems.

    Um, PowerShell *is* a command line.

    Different from CMD.EXE, but still a command line.

    --
    The randomly chosen signature file that would have appeared here is more than 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/IceCream

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Igenlode Wordsmith@21:1/5 to All on Mon Jul 25 22:19:01 2022
    On 25 Jul 2022 Mack The Knife wrote:

    The gnuwin32 version of gawk is ancient. Don't use it. Use the version
    from ezwinports, which is what's supported under Windows by the GNU >developers.

    Thanks for the pointer that I need to focus my efforts on the ezwinports
    site -- I continued to get UnacceptableType errors when attempting to
    download anything there, but was able to get into the site by switching
    to another browser, and to download something that says it is Gawk 5.1.1
    (more modern than the most recent port available for my system!)

    How one gets that downloaded content to work is of course another
    question. (I know literally virtually nothing about software
    installation under Windows - the last time I had to fiddle around with a foreign filing system, it was writing BAT files for a pre-Windows
    version of MS-DOS where you had to manually enter the system date before running the singletasking software...)

    Presumably once the files have been put in the proper locations you can
    then invoke them from the command line -- however one manages to access
    that from Windows!

    Reading the small print, I have a nasty feeling that she won't be able
    to open the required GNU C/C++ libraries, which are apparently tar.xz
    files.

    [snip]


    Cygwin is an alternative; it provides the possibility of a POSIX-style >environment under Windows, including gawk, but is probably more than
    you want.

    Definitely more than I can ask her to take on in order to test out a
    simple gawk script, I think! Although by the looks of it, attempting to
    get gawk running under Windows at all is going to be more complicated
    than I can really expect her to handle :-(

    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    * Never assume malice when ignorance is a possibility *

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Igenlode Wordsmith@21:1/5 to All on Sun Jul 24 23:47:26 2022
    I've been trying to share a gawk script for doing some processing on a
    Web page with a friend - it is theoretically cross-platform portable,
    but she runs Windows and I don't. (I don't even know which version of
    Windows she has; presumably the latest, whichever that is?)

    She is having trouble in installing gawk on her computer. It looks as if
    she needs to download GnuWin32 (or Cygwin?), but the downloads linked at https://downloads.sourceforge.net/project/gnuwin32/gawk/3.1.6-1/gawk-3.1.6-1-setup.exe
    and
    https://downloads.sourceforge.net/project/ezwinports/gdb-12.1-w32-bin.zip simply fail (and failed for me too when I tested them).

    How does one set about running gawk under Windows nowadays? All the
    references at http://gnuwin32.sourceforge.net/install.html look
    worryingly ancient, and I know next to nothing about Windows software installation myself, while she is a self-admitted 'tech novice'.

    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    * Usenet: Warning, may contain Nuts *

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Igenlode Wordsmith@21:1/5 to All on Tue Jul 26 09:16:06 2022
    On 25 Jul 2022 Stuart Ferguson wrote:

    On Monday, 25 July 2022 at 07:07:04 UTC+1, Igenlode Wordsmith wrote:

    How does one set about running gawk under Windows nowadays?

    To use gawk on Windows with the minimum of fuss, try installing
    gawk using the Scoop package manager (https://scoop.sh/).

    Once you have scoop installed, which is a 5-minute job and requires
    no administrator rights, "scoop install gawk" will have you up and
    running straight away.

    Thanks for the suggestion, which I have forwarded to my friend as a
    solution that only involves installing *one* piece of software...
    (although again, looking at the 'json' file for gawk, I think she might
    need to do an 'install 7zip' first in order to be able to decompress the files!)

    After reading https://www.makeuseof.com/windows-install-scoop/ I would
    have thought most Windows users would actually find a graphical
    installer less intimidating than one that involves enabling a PowerShell interface that gives you far-reaching access to the innards of your
    computer, and then typing cryptic one-line instructions like
    "iwr -useb get.scoop.sh | iex"

    However, she seems quite sanguine at the prospect of doing all this
    extra install work, which I had not expected :-)

    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    - I don't want to 'fit in' any more... - That makes two of us!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Russell Marks@21:1/5 to Igenlode Wordsmith on Tue Jul 26 08:42:21 2022
    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:

    Definitely more than I can ask her to take on in order to test out a
    simple gawk script, I think! Although by the looks of it, attempting to
    get gawk running under Windows at all is going to be more complicated
    than I can really expect her to handle :-(

    If you don't need gawk specifically, one of the simpler options which
    doesn't seem to need extra libraries installed is this BusyBox port:

    https://frippery.org/busybox/

    You could e.g. rename busybox.exe to awk.exe to avoid having to run it
    with "busybox awk".

    -Rus.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Igenlode Wordsmith@21:1/5 to All on Tue Jul 26 10:05:36 2022
    On 26 Jul 2022 Russell Marks wrote:

    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:

    Definitely more than I can ask her to take on in order to test out a
    simple gawk script, I think! Although by the looks of it, attempting to
    get gawk running under Windows at all is going to be more complicated
    than I can really expect her to handle :-(

    If you don't need gawk specifically, one of the simpler options which
    doesn't seem to need extra libraries installed is this BusyBox port:

    https://frippery.org/busybox/

    Thanks - an interesting suggestion, especially as I wasn't aware of
    having any gawk-specific code.
    However, a quick test using "gawk -c" for compatibility mode immediately
    throws up 'strftime' as being a gawk extension, and as the whole script
    is based heavily around checking formatted dates it looks as if I do
    need gawk in particular. Which is worth knowing anyhow...

    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    * Never assume malice when ignorance is a possibility *

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to Use-Author-Supplied-Address-Header@ on Tue Jul 26 12:49:41 2022
    In article <20220726094300.910641200F1@fleegle.mixmin.net>,
    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:
    ...
    Thanks - an interesting suggestion, especially as I wasn't aware of
    having any gawk-specific code.

    However, a quick test using "gawk -c" for compatibility mode immediately >throws up 'strftime' as being a gawk extension, and as the whole script
    is based heavily around checking formatted dates it looks as if I do
    need gawk in particular. Which is worth knowing anyhow...

    Interestingly enough, I just tested busybox AWK on Linux, and it has strftime(). Color me both surprised and impressed. In fact, though I
    expected it to be pretty easy to find something that broke it, I was unable
    to do it (in a very short/quick session of playing with it).

    So, I'd give it a try.

    P.S. I wouldn't be all that surprised if the AWK in busybox *was* (more or less) gawk. Like, where else would they look?

    P.P.S. OK, yeah, I just tested some more and (surprising absolutely no
    one), it does not recognize the "-l" command line option, so you can't load functions from a shared library, like you can in GAWK...

    --
    In Usenet, as in life, as you go through it, you will run into lots of nonsense.
    Each time, you will have to decide from the following courses of action:
    1) Argue with it or 2) Ignore it.
    Experience shows that the later course is usually the best.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Kenny McCormack on Tue Jul 26 20:21:05 2022
    On 2022-07-26, Kenny McCormack <gazelle@shell.xmission.com> wrote:
    In article <20220726094300.910641200F1@fleegle.mixmin.net>,
    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:
    ...
    Thanks - an interesting suggestion, especially as I wasn't aware of
    having any gawk-specific code.

    However, a quick test using "gawk -c" for compatibility mode immediately >>throws up 'strftime' as being a gawk extension, and as the whole script
    is based heavily around checking formatted dates it looks as if I do
    need gawk in particular. Which is worth knowing anyhow...

    Interestingly enough, I just tested busybox AWK on Linux, and it has strftime(). Color me both surprised and impressed. In fact, though I

    Why; this is a a standard C library function dating back to ANSI C 89
    (and beyond) with a fixed arity. Wrapping it in a programming language interpreter that already wraps other library functions should about a 30
    minute job, including documentation (which would just point the user
    to the manual for strftime for the format codes).

    expected it to be pretty easy to find something that broke it, I was unable to do it (in a very short/quick session of playing with it).

    So, I'd give it a try.

    P.S. I wouldn't be all that surprised if the AWK in busybox *was* (more or less) gawk. Like, where else would they look?

    The Awk in BusyBox is definitely not Gawk; and that sort of inclusion
    would defeat the whole point of BusyBox.

    The point of BusyBox is providing common utilities in a small space,
    mainly for embedded systems. BusyBox compiles all the utilities into
    a single executable.

    Here is BusyBox on one Arm-based embedded system I'm working with:

    # ls -l /bin/busybox.nosuid
    -rwxrwxr-x 1 1000 1000 1052020 Jul 22 23:36 /bin/busybox.nosuid

    It's about a megabyte, which contains all the utilities BusyBox
    provides, including the shell and Awk.

    GNU Awk alone would probably take up something like 80% of that size.

    Not everything in BusyBox is original. For instance, regarding the
    shell, the source tree contains the ports of two shells: ash
    (the Almquist shell) and something called hush. GNU Bash would not
    be practical.

    BusyBox Awk seems original, though. Oh look, by someone with
    an Ukrainian e-mail address:

    /*
    * awk implementation for busybox
    *
    * Copyright (C) 2002 by Dmitry Zakharov <dmit@crp.bank.gov.ua>
    *
    * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    */

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Igenlode Wordsmith@21:1/5 to All on Wed Jul 27 00:13:38 2022
    On 26 Jul 2022 Kaz Kylheku wrote:

    On 2022-07-26, Kenny McCormack <gazelle@shell.xmission.com> wrote:
    In article <20220726094300.910641200F1@fleegle.mixmin.net>,
    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:
    ...
    Thanks - an interesting suggestion, especially as I wasn't aware of >>>having any gawk-specific code.

    However, a quick test using "gawk -c" for compatibility mode immediately >>>throws up 'strftime' as being a gawk extension, and as the whole script >>>is based heavily around checking formatted dates it looks as if I do
    need gawk in particular. Which is worth knowing anyhow...

    Interestingly enough, I just tested busybox AWK on Linux, and it has
    strftime(). Color me both surprised and impressed. In fact, though I

    Why; this is a a standard C library function dating back to ANSI C 89
    (and beyond) with a fixed arity. Wrapping it in a programming language >interpreter that already wraps other library functions should about a 30 >minute job, including documentation (which would just point the user
    to the manual for strftime for the format codes).

    [snip]

    Well, I ran the --lint option over my script, and it didn't highlight
    anything other than strftime() as a gawk extension... although just from
    a manual scan I can see that I used 'nextfile', and *that* is listed as
    being available in gawk only. So I'm not sure how far the lint results
    are to be relied upon :-(


    Otherwise a small self-contained implementation sounds like exactly what
    I am looking for...



    (I could post the entire script here to see if anyone can spot anything
    else. But it's embarrassingly spaghetti-fied...)



    The Awk in BusyBox is definitely not Gawk; and that sort of inclusion
    would defeat the whole point of BusyBox.

    The point of BusyBox is providing common utilities in a small space,
    mainly for embedded systems. BusyBox compiles all the utilities into
    a single executable.

    I found a mention of Busybox awk in the page on Other Versions, where it
    is described as "a full implementation of POSIX awk": https://www.gnu.org/software/gawk/manual/html_node/Other-Versions.html

    Testing with the --posix option doesn't throw up anything other than
    strftime, which ironically Busybox awk apparently does support.

    [Edit: assuming this is in fact the Busybox awk source code, the list
    of keywords in static const char tokenlist[] includes both 'strftime'
    and 'nextfile' https://github.com/brgl/busybox/blob/master/editors/awk.c
    ]


    Here is BusyBox on one Arm-based embedded system I'm working with:

    # ls -l /bin/busybox.nosuid
    -rwxrwxr-x 1 1000 1000 1052020 Jul 22 23:36 /bin/busybox.nosuid

    It's about a megabyte, which contains all the utilities BusyBox
    provides, including the shell and Awk.

    GNU Awk alone would probably take up something like 80% of that size.

    My copy of gawk is 1326Kb as a stand-alone file - the binaries directory
    in one of the Windows distributions I downloaded last night was 5Mb.


    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    Those jaded in their emotions demand monstrous things to arouse them

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Igenlode Wordsmith on Wed Jul 27 06:15:16 2022
    On 26.07.2022 11:05, Igenlode Wordsmith wrote:

    Thanks - an interesting suggestion, especially as I wasn't aware of
    having any gawk-specific code.
    However, a quick test using "gawk -c" for compatibility mode immediately throws up 'strftime' as being a gawk extension, and as the whole script
    is based heavily around checking formatted dates it looks as if I do
    need gawk in particular. Which is worth knowing anyhow...

    Yes, strftime is a GNU Awk extension (which may be available in other
    awk versions or not). You still have to be careful since there's no
    guaranteed set of supported time format specifiers; it depends on the
    platform, which version of POSIX, and the underlying libraries. And
    the documentation of the underlying strftime library function may not
    even reflect what works with the awk on the same platform (been there).
    There's a huge set of commonly supported format specifiers, but be
    careful with some of the exotic ones; tests before going in production
    with your programs help.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mack The Knife@21:1/5 to Use-Author-Supplied-Address-Header@ on Wed Jul 27 08:19:23 2022
    In article <20220727002858.8BAA01200B2@fleegle.mixmin.net>,
    Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:
    Well, I ran the --lint option over my script, and it didn't highlight >anything other than strftime() as a gawk extension... although just from
    a manual scan I can see that I used 'nextfile', and *that* is listed as
    being available in gawk only. So I'm not sure how far the lint results
    are to be relied upon :-(

    It looks like you're looking at a (very) old manual. nextfile was
    accepted by the POSIX committee in 2012 for inclusion into awk
    and should be in the current standard (from 2017 or 2018). This is the
    reason --lint doesn't complain. At the very least gawk, mawk and
    The One True Awk implement nextfile. Apparently current busybox awk
    does as well.

    HTH,

    Mack The Knife

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Manuel Collado@21:1/5 to All on Wed Jul 27 11:05:58 2022
    El 25/07/2022 a las 0:47, Igenlode Wordsmith escribió:

    How does one set about running gawk under Windows nowadays? All the references at http://gnuwin32.sourceforge.net/install.html look
    worryingly ancient, and I know next to nothing about Windows software installation myself, while she is a self-admitted 'tech novice'.

    I have my own 32bit Windows port of gawk-5.1.0. Ready to be used by
    anybody else. Available at

    http://mcollado.z15.es/xgawk/win32/

    Just download gawk-5.1.0-win32-bin.zip, unpack it on c:\gnu, and put
    c:\gnu\bin in the path. That's all.

    The distribution archive contains all the required DLL libraries as well
    as full documentation in HTML and PDF formats.

    HTH.
    --
    Manuel Collado - http://mcollado.z15.es

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Igenlode Wordsmith@21:1/5 to All on Wed Jul 27 22:11:11 2022
    On 27 Jul 2022 Manuel Collado wrote:

    El 25/07/2022 a las 0:47, Igenlode Wordsmith escribió:

    How does one set about running gawk under Windows nowadays? All the
    references at http://gnuwin32.sourceforge.net/install.html look
    worryingly ancient, and I know next to nothing about Windows software
    installation myself, while she is a self-admitted 'tech novice'.

    I have my own 32bit Windows port of gawk-5.1.0. Ready to be used by
    anybody else. Available at

    http://mcollado.z15.es/xgawk/win32/

    Just download gawk-5.1.0-win32-bin.zip, unpack it on c:\gnu, and put >c:\gnu\bin in the path. That's all.

    The distribution archive contains all the required DLL libraries as well
    as full documentation in HTML and PDF formats.

    Thanks -- that sounds like exactly what I was originally hoping to
    find. I've forwarded her the link, and we'll have another go at gawk
    over the weekend, with Busybox as a fallback alternative.

    (Inevitably, I've managed to find another bug in the script
    meanwhile...)

    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    - I don't want to 'fit in' any more... - That makes two of us!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Igenlode Wordsmith@21:1/5 to All on Sun Jul 31 16:42:05 2022
    Oops, sorry -- I meant to send this to the newsgroup, not directly to
    Manuel (not least because my email is currently broken...)

    On 27 Jul 2022 Manuel Collado wrote:


    I have my own 32bit Windows port of gawk-5.1.0. Ready to be used by
    anybody else. Available at

    http://mcollado.z15.es/xgawk/win32/

    Just download gawk-5.1.0-win32-bin.zip, unpack it on c:\gnu, and put >c:\gnu\bin in the path. That's all.

    The distribution archive contains all the required DLL libraries as well
    as full documentation in HTML and PDF formats.


    She tried this, and got the error "The code execution cannot proceed
    because libgmp-10.dll was not found" -- and indeed I can't find any such
    file within the archive, so presumably it's a dependency that was unintentionally compiled into the distribution? :-(

    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    -Yes, it hurts. The trick is not *minding* that it hurts.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bruce Horrocks@21:1/5 to Igenlode Wordsmith on Sun Jul 31 21:32:20 2022
    On 31/07/2022 16:42, Igenlode Wordsmith wrote:
    Oops, sorry -- I meant to send this to the newsgroup, not directly to
    Manuel (not least because my email is currently broken...)

    On 27 Jul 2022 Manuel Collado wrote:


    I have my own 32bit Windows port of gawk-5.1.0. Ready to be used by
    anybody else. Available at

    http://mcollado.z15.es/xgawk/win32/

    Just download gawk-5.1.0-win32-bin.zip, unpack it on c:\gnu, and put
    c:\gnu\bin in the path. That's all.

    The distribution archive contains all the required DLL libraries as well
    as full documentation in HTML and PDF formats.


    She tried this, and got the error "The code execution cannot proceed
    because libgmp-10.dll was not found" -- and indeed I can't find any such
    file within the archive, so presumably it's a dependency that was unintentionally compiled into the distribution? :-(

    I went to [1] and downloaded [2]. Unzipped [2], started a Windows
    command shell, CD'd into the directory containing gawk.exe and ran the
    command

    .\gawk.exe --version

    which worked first time. This was Windows 10.

    [1] http://vkiefel.de/compiled-SW.html

    [2] http://vkiefel.de/gawk-5.1.0-win32.zip

    --
    Bruce Horrocks
    Surrey, England

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Igenlode Wordsmith@21:1/5 to All on Mon Aug 1 10:11:29 2022
    On 31 Jul 2022 Bruce Horrocks wrote:


    I went to [1] and downloaded [2]. Unzipped [2], started a Windows
    command shell, CD'd into the directory containing gawk.exe and ran the >command

    .\gawk.exe --version

    which worked first time. This was Windows 10.

    [1] http://vkiefel.de/compiled-SW.html

    [2] http://vkiefel.de/gawk-5.1.0-win32.zip

    Thanks for the suggestion, which I have (again!) forwarded onwards.

    I'm a bit surprised by the small size of the 'gawk.exe' file here, since
    the one in the other archive was 6 Mb -- would that be because it
    *doesn't* have the Cygwin stuff compiled in with it, or is it an
    indication that it expects to link to external libraries?

    --
    Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

    * Ain't never gonna stop the rain by complainin'... *

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bruce Horrocks@21:1/5 to Igenlode Wordsmith on Mon Aug 1 17:27:13 2022
    On 01/08/2022 10:11, Igenlode Wordsmith wrote:
    On 31 Jul 2022 Bruce Horrocks wrote:


    I went to [1] and downloaded [2]. Unzipped [2], started a Windows
    command shell, CD'd into the directory containing gawk.exe and ran the
    command

    .\gawk.exe --version

    which worked first time. This was Windows 10.

    [1] http://vkiefel.de/compiled-SW.html

    [2] http://vkiefel.de/gawk-5.1.0-win32.zip

    Thanks for the suggestion, which I have (again!) forwarded onwards.

    I'm a bit surprised by the small size of the 'gawk.exe' file here, since
    the one in the other archive was 6 Mb -- would that be because it
    *doesn't* have the Cygwin stuff compiled in with it, or is it an
    indication that it expects to link to external libraries?

    Despite its small size it is self-contained so nothing further to install.

    I've no idea why the Cygwin one is so big, tbh.

    --
    Bruce Horrocks
    Surrey, England

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)