[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problems with multiline records in gawk 3.1.2
From: |
Jukka Salmi |
Subject: |
Problems with multiline records in gawk 3.1.2 |
Date: |
Mon, 26 May 2003 12:36:22 +0200 |
User-agent: |
Mutt/1.5.4i |
Hello,
There is a problem with multiline records in GNU Awk 3.1.2. Versions
before 3.1.2 don't have it. The following should describe the problem:
$ od -c data
0000000 a \n \n b \n \n c \n
0000010
$ cat pr.awk
BEGIN { RS = "" }
{ printf("%d: %s\n", NR, $0) }
END { print NR }
$ awk -f pr.awk data
1: a
2: b
3: c
3
$ cat data | awk -f pr.awk
1: a
2: b
2
$ awk -f pr.awk <data
1: a
2: b
3: c
3
Somehow record #3 got lost when using 'cat ... | awk ...'.
I'm using GNU Awk 3.1.2 and bash 2.05b.0(1) on a Gentoo GNU/Linux system.
Greetings,
Jukka
--
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~
- Problems with multiline records in gawk 3.1.2,
Jukka Salmi <=