bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] Potential awk bug in comment line with combination # and ' ch


From: Dave
Subject: [bug-gawk] Potential awk bug in comment line with combination # and ' characters.
Date: Sun, 24 Jun 2012 10:54:02 -0400

TO: address@hidden

>From David M. Boulin
     address@hidden
Date: 6-24-2012

Summary of suspected COMMENT LINE   awk bug:
1) Combinations with # followed by one or more "'" give errors or unpredictable
results as shown below. These include  # '   and     # '|'  ,    etc.

2) Note:from "info awk":   Definition of a comment:
Comments  begin  with  the “#” character, and continue
                       until the end of the line.
        As far a I can tell there are no stated exemptions
on what characters can be used in a comment line.
===============================================================================
OS: Linux 3.0.0-21-generic (i686)
awk version: GNU Awk 3.1.8
C compiler: GNU C Compiler version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
Distribution: Ubuntu 11.10
value of LC_ALL= null initially
value of LC_ALL= C  No change to results posted below after setting this and
                    re-executing the awk script file..
===============================================================================



===============================================================================
The AWK program is in a file called 'testit' which is executable (-rwxrw-r--):
It's contents followd:
awk '
# Prog testit to demo a bug. Change comment line below and see NOTES for results:

        { print "Hello World" }
     ' datafile

===============================================================================


===============================================================================
Contents of the datafile:
$ cat datafile
LineFromDataFile
$
===============================================================================


===============================================================================
By changing the 3rd line which initial consisting only of a pound sign  #  to
the following list of string examples, then execute via ./testit,  you
will get the results shown (some spaced deleted in error line for brevity).

Content of
third line: Results Comment
---------       ------- -------
# Hi Hello World As expected
# " " Hello World As expected

#Use '|' blabla ./testit:line 5:$' blabla\n\t{ print "Hello World" }\n': command not found
# '|'         ./testit: line 5: $'\n\t{ print "Hello World" }\n ': command not found
# ' ./testit: line 8: syntax error: unexpected end of file
# ' ' No output - no reported errors
# 'x' Hello World  - no reported errors
===============================================================================

>From "info awk" page:
BUG REPORTS
       If you find a  bug  in  gawk,  please  send  electronic  mail  to
        address@hidden

Hope this has been of some help.
I look forward to your reply,
  Dave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]