[gpm]RE: getting the one true AWK

Mark Hymers markh@linuxfromscratch.org
Thu, 3 Jan 2002 21:33:44 +0000


Hi,

The patch I posted doesn't work!

There's a problem with line 99 of the manpager script:

/^[ \t]/        {gsub("^[ \t]*","");}

works in gawk and the original awk quite nicely.

Unfortunately, in mawk it removes all the spaces from the options text
like this:

-A [limit]
              Startupwithselectionpastingdisabled.Thisisintendedasa securitymeasure;aplausibleattackonasys-
              temseemstobeto stuffanastyshellcommandintotheselectionbuffer
(rm-rf/)includingtheterminating-
              linebreak,thenallthevictimhastodoisclickthemiddlemousebutton..  Asofversion1.17.2,thishasde-
              veloped intoamoregeneralagingmechanism;thegpmdaemoncandisable(age)selectionpasting  automati-
              callyafteraperiodofinactivity.Toenablethismodejustgivetheoptionallimitparameterwhichis inter-
              pretedasthetimeinsecondsforwhichaselectionisconsideredvalidandpastable.        Asofver-
              sion1.15.7,atrivialprogramcalleddisable-pasteisprovided.Thefollowingmakesagood     addi-
              tionto/etc/profileifyouallowmultipleuserstoworkonyourconsole.

which isn't *quite* what was intended ;-)

This looks like a bug in mawk, it doesn't appear to be observing the ^
for start of line.

In mawk, this works:

/^[\ ]/        {gsub("^[\ ]","");}
/^[\t]/        {gsub("^[\t]","");}

unfortunately, in gawk and the original awk, this fails to remove a lot
of the spaces we need removed.

So, basically, I can get it to work with gawk, mawk and awk; just not
all at once!

The only final suggestion I can come up with is a horrible hack.  Get
configure to detect exactly which out of gawk, mawk and awk is being
used and call manpager or manpager-mawk.  Would that be an acceptable
work-around?

Any other ideas 'cos I'm all out!

Mark

-- 
Mark Hymers					 BLFS Editor
markh@linuxfromscratch.org