TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: MARTIN GREGORIE
from: CHRIS ELVIDGE
date: 2021-01-20 11:29:00
subject: Re: Battery Powered Proje

On 20/01/2021 10:49 am, Martin Gregorie wrote:
> On Wed, 20 Jan 2021 10:03:49 +0000, Pancho wrote:
>
>> On 19/01/2021 22:15, Martin Gregorie wrote:
>>
>>>> I think you are missing the point. If I pipe 4095 characters into
>>>> mawk,
>>>> nothing happens, if a pipe an extra char to make 4096, it prints out.
>>>
>>> Thats definitely faulty behaviour: pipe operation should not depend on
>>> how full the pipe is.
>>>
>>>
>> Richard explained it better than me. It's mawk waiting until it has a
>> block of 4096 bytes (or EOF). Clearly designed behaviour.
>>
>> With 20.04, Ubuntu seems to have switched from mawk to gawk as default
>> awk. I don't know if this is Ubuntu specific or Debian. So it's quite
>> possible this will be reflected in the next version of Raspbian
>> (Rasberry Pi OS)
>>
>> This is exactly what I mean by fragile. Someone writes a script to do
>> something using awk, an OS update comes along and the app completely
>> changes.
>
> In Fedora systems the binary is called gawk with awk as an alias
> In Raspbian Buster the binary is /usr/bin/mawk with awk and nawk as
> aliases
>
> So, the same shell script should run in both places: my test scripts do
> exactly that *and* do not show the long delay you're seeing.
>
>

In mine, Linux raspi-3plus 5.4.79-v7+ #1373 SMP Mon Nov 23 13:22:33 GMT
2020 armv7l GNU/Linux,

# ls -l /usr/bin/?awk
-rwxr-xr-x 1 root root 537K Sep 14  2018 /usr/bin/gawk*
-rwxr-xr-x 1 root root  93K Apr  8  2012 /usr/bin/mawk*
lrwxrwxrwx 1 root root   22 May 27  2020 /usr/bin/nawk ->
/etc/alternatives/nawk*

so mawk is well out of date!

/usr/bin/awk -> /etc/alternatives/awk -> /usr/bin/gawk

/usr/bin/mawk -W version says:
mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan

compiled limits:
max NF             32767
sprintf buffer      1020

So really, well worth linking awk to gawk if you can.

--
Chris Elvidge
England

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.