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 *
How does one set about running gawk under Windows nowadays?
How does one set about running gawk under Windows nowadays?
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".
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.
How does one set about running gawk under Windows nowadays?
have no command line experience. However, those same people use
gawk applications at the PowerShell prompt with no problems.
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.
Cygwin is an alternative; it provides the possibility of a POSIX-style >environment under Windows, including gawk, but is probably more than
you want.
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.
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 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...
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?
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).
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.
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...
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 :-(
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'.
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.
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.
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
On 31 Jul 2022 Bruce Horrocks wrote:
I went to [1] and downloaded [2]. Unzipped [2], started a WindowsThanks for the suggestion, which I have (again!) forwarded onwards.
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
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?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 15:00:55 |
Calls: | 6,706 |
Files: | 12,239 |
Messages: | 5,351,159 |