Re: "make search" oddity

From: Matthew Seaman (m.seaman_at_infracaninophile.co.uk)
Date: 07/09/04

  • Next message: Alex Mitchell: "LRZSZ"
    Date: Fri, 9 Jul 2004 21:47:35 +0100
    To: freebsd-questions@freebsd.org
    
    
    

    On Fri, Jul 09, 2004 at 03:22:45PM -0400, Mark Frank wrote:
    > * On Thu, Jul 08, 2004 at 10:05:35PM +0100 Matthew Seaman wrote:

    > > Hmmm... what awk(1) program is first on your path? And if it isn't
    > > the default version supplied with the system (/usr/bin/awk -- in 4.10
    > > this is actually GNU Awk 3.0.6) does it support 'IGNORECASE'? There's
    > > this little snippet in the awk(1) man page:
    > >
    > > NOTE: In versions of gawk prior to 3.0, IGNORECASE only
    > > affected regular expression operations. It now affects
    > > string comparisons as well.
    >
    > I only have one copy of awk on the box. Things like awk I usually take
    > for granted and don't think about. Here's what I think I see, please
    > correct me if I'm wrong.

    If you're using the version of awk supplied with the system and the
    systems you're running aren't hugely out of date, then you shouldn't
    have a problem.
     
    > On all my 5.2.1-RELEASE boxes the version of awk appears to be the
    > one-true-awk which I believe is the old AT&T/Lucent awk. I don't know
    > how to extract the exact version number but obviously doesn't support
    > IGNORECASE. I've never done anything intentionally to change versions
    > of awk on any of these.

    Hmmm... The 5.x awk(1) man page certainly doesn't mention IGNORECASE
    (which is a GNU extension and not in the POSIX awk specification). I
    do think it odd that all those improvements to the ports search
    facility should have been committed with a large chunk of
    functionality not working under 5.x. None the less, that appears to
    have been the case.

    IGNORECASE support hasn't been added to the one-true-awk in 5.x as far
    as I can tell. I can find no mention of it searching through the
    sources via cvsweb.cgi -- mind you, that may well be because I just
    didn't manage to search very effectively. Could you try running this
    command on a 5.x system?

        % echo aB | awk 'BEGIN { IGNORECASE=1; } /ab/ { print "IGNORECASE works" }'

    On 4.x that prints out 'IGNORECASE works' -- from what you've said,
    I'd expect no output on 5.x

    Looks like you've spotted a bug.

    > The only 4.x system I have is a 4.8 box which has never gone through a
    > buildworld/installworld cycle (it's a poor old Pentium that's just used
    > as a caching DNS server in my LAN) and it does have GNU Awk 3.0.6 on it.
    > If I did a buildworld/installworld on it, would it use the Makefile in
    > /usr/src/usr.bin/awk, which seems to point to the source for the
    > one-true-awk?

    No -- 4.x uses and will use GNU awk all the way. It's one of those
    policy things: not to make potentially disruptive changes like
    replacing an important application with one using a completely
    different software base within the life of a system major version.

    With 5.x they've switched to a BSD licensed awk(1) implementation.
    They're going to do much the same with tar(1), if they haven't already
    -- so long as they can make the switch before 5.3 goes stable. If
    they miss that, bsdtar will have to wait until 6.x. Ultimately the
    idea is to provide a purely BSD licensed system, but it will be quite
    a long time before there's a suitable replacement for gcc(1) and the
    rest of the compiler toolchain available.

    > I do see the GNU version of awk in ports, gawk-3.1.1_1. Should I be
    > using that? Will it break something else if I install it and link
    > /usr/bin/awk to it?

    You can certainly install gawk from ports if you want, but I wouldn't
    go replacing the system version with it -- awk(1) is vital for
    rebuilding world, kernel and you wouldn't want to run the risk of
    breaking that. After all, being able to do a case insensitive search
    of the ports INDEX is not actually that important in the grand scheme
    of things.

            Cheers,

            Matthew

    -- 
    Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                          Savill Way
    PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
    Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
    
    



  • Next message: Alex Mitchell: "LRZSZ"

    Relevant Pages

    • Re: How to find all files between midnight and 08.00 am?
      ... know of) that uses linux begins to learn what "ls" does. ... IMHO: awk is personal knowledge ... info about sub() but it doesn't right now. ... The part about replacing something is written just above that. ...
      (comp.unix.shell)
    • Re: Sed line transpose
      ... I want to transpose every two lines, replacing the odd witht he even ... and vice versa. ... I'd use awk, not sed: ...
      (comp.unix.questions)
    • Re: Search and replace with a BASIC program
      ... Use the RISC OS ports of the Unix command line tools such as sed and ... awk. ... Although their syntax is a bit archaic, ...
      (comp.sys.acorn.programmer)
    • Re: OT When did I know I was old...
      ... (Eugene Griessel) ... Ports especially French ones ... Never write it in C if you can do it in 'awk'; Never do it in 'awk' if ... Never invoke 'tr' when 'cat' is sufficient; ...
      (sci.military.naval)
    • Quick AWK help
      ... What is wrong in this awk line? ... In this line I am trying to get the total connections for ports 8005 and ... Customer Knowledge System (CKS). ...
      (SunManagers)