[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in gawk when both RS="" and file contains only empty lines
From: |
Michel Jouvin |
Subject: |
Bug in gawk when both RS="" and file contains only empty lines |
Date: |
Thu, 19 Jul 2001 15:30:34 +0100 |
I have a problem with gawk on Linux RH 6.2. The problem exists both
with the original version (3.0.4) and 3.1 I installed.
I use gawk with the following parameters :
gawk 'BEGIN {RS=""} {print "Next record :", $0}' input_file
This command prints all the lines of the input file as records (FS=\n
implied. the problem remains the same with an explicit FS=\n). This
works perfectly as long as the file is empty or conatins one non empty
line.
But if it happens that input_file is made only of empty lines (one or
several, it doesn't matter but lines should not contain even a space),
gawk never exits.
I don't reproduce this behaviour with awk (non Gnu) on other platforms
(like Tru64 awk for example) where awk just exits as if the file was
empty.
Thanks in advance for any help.
Michel
*************************************************************
* Michel Jouvin Email : address@hidden *
* LAL / CNRS Fax : +33 1 69079404 *
* B.P. 34 *
* 91898 Orsay Cedex *
* France *
*************************************************************
- Bug in gawk when both RS="" and file contains only empty lines,
Michel Jouvin <=