* problem with awk under OSF/1 3.0
@ 1995-01-09 15:07 msdc!osfmgt
0 siblings, 0 replies; 2+ messages in thread
From: msdc!osfmgt @ 1995-01-09 15:07 UTC (permalink / raw)
To: tru64-unix-managers
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* problem with awk under OSF/1 3.0
@ 1995-01-10 10:28 msdc!osfmgt
0 siblings, 0 replies; 2+ messages in thread
From: msdc!osfmgt @ 1995-01-10 10:28 UTC (permalink / raw)
To: tru64-unix-managers
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1995-01-10 10:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-01-10 10:28 problem with awk under OSF/1 3.0 msdc!osfmgt
-- strict thread matches above, loose matches on Subject: below --
1995-01-09 15:07 msdc!osfmgt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox