tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: msdc!osfmgt () uunet ! uu ! net (Elizabeth I !  Sewell)
To: tru64-unix-managers
Subject: problem with awk under OSF/1 3.0
Date: Tue, 10 Jan 1995 10:28:14 +0000	[thread overview]
Message-ID: <96075316706405.tru64-unix-managers.marc@archive.invalid> (raw)


We recently upgraded our Alpha 4000/610 from OSF/1 2.0 to version 3.0.
Apparently there is a "feature/bug" in awk under OSF/1 3.0 that occurs 
under the following condition:

Suppose I'm printing the fourth field on a line ($4) (assuming each field
is colon delimited) with the following awk script: 

    BEGIN \
	    {
	    FS = ":"
	    }
	    {
	    printf "    %s\n", $4
	    }

The following input yields unexpected results:

    a1:a2:a30:a4
    b1:b2:b3:

The output looks like:

    a4
    a4

I expect the second line to be blank.  Instead it picks up
$4 from the previous line.  When I print NF for the second line, it 
prints "4" (i.e. it thinks it has four fields).  The other *very* strange
fact is that if the fields on the first line are all of the same length
(e.g. $3 == a3 instead of a30), the problem does not occur.
Furthermore, if I delimit the fourth field on the second line so that it looks
like: b1:b2:b3::   the problem goes away.  Finally, if I use 'oawk' from
	     ^^^
the OSFOBSOLETE300 subset, the problem does not occur.

The good news is that I can change the input to avoid the problem.  The
bad news is that *many* of our jobs use awk to process data for reports, etc.
This is going to be a huge task.

Is this a known bug for which a patch might be available?  Is this a feature
of the new awk that I'm just going to have to deal with?  Any information
would be much appreciated.  I apologize if this is the incorrect forum
for this question.

Thanks for your input.

Beth Sewell (osfmgt@msdc.com)
Medical Systems Development Corporation				    Atlanta, GA

             reply	other threads:[~1995-01-10 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-01-10 10:28 msdc!osfmgt [this message]
  -- strict thread matches above, loose matches on Subject: below --
1995-01-09 15:07 problem with awk under OSF/1 3.0 msdc!osfmgt
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox