bug-gnu-utils
[Top][All Lists]
Advanced

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

gawk 3.1.2 bug


From: Kast, Scott
Subject: gawk 3.1.2 bug
Date: Fri, 18 Apr 2003 10:46:46 -0400

I think there are some parsing issues in gawk 3.1.2.
 
I have two files...
Request+2003+04+16+16+04:23:26+PM 
which contains...
#!/bin/sh
 
cat << __SBACSS_RPT_FORMAT__
Content-type: text/html
 
<HTML>
<BODY BGCOLOR="#FFFFFF">
<META REPORT-INFO=TIIP Batch Report>
</BODY>
</HTML>
__SBACSS_RPT_FORMAT__
and
Request+2003+04+16+16+04:30:18+PM.csv
which contains...
#!/bin/sh
#<META REPORT-INFO=TIIP Non-Payment Export>
 
cat <<__SBACSS_RPT_FORMAT__
Content-type: text/csv
 
__SBACSS_RPT_FORMAT__
 
When I run...
ls -r Request* | gawk-3.0.6 '
{
  title = ""
  "head " $0 " | grep \"<META REPORT-INFO=\"" | getline title
  sub("^\\#", "", title)
  sub("<META REPORT-INFO=", "", title)
  sub(">", "", title)
  if(title == "") title = "Untitled"
 
  split($0, rr, "+")
  istxt = sub("\.t.t$", "", rr[7])  # rip ".t?t" off
  iscsv = sub("\.csv$", "", rr[7])  # rip ".csv" off
  if(iscsv) istxt=iscsv
 
  print title
  print istxt
 
}
'
I get the following output...
TIIP Non-Payment Export
0
TIIP Batch Report
0
When I run...
ls -r Request* | gawk-3.1.2 '
{
  title = ""
  "head " $0 " | grep \"<META REPORT-INFO=\"" | getline title
  sub("^\\#", "", title)
  sub("<META REPORT-INFO=", "", title)
  sub(">", "", title)
  if(title == "") title = "Untitled"
 
  split($0, rr, "+")
  istxt = sub("\.t.t$", "", rr[7])  # rip ".t?t" off
  iscsv = sub("\.csv$", "", rr[7])  # rip ".csv" off
  if(iscsv) istxt=iscsv
 
  print title
  print istxt
 
}
'
I get the following output...
gawk-3.1.2: cmd. line:11: warning: escape sequence `\.' treated as plain `.'
sh: -c: line 1: syntax error near unexpected token `|'
sh: -c: line 1: ` | grep "<META REPORT-INFO="'
Untitled
0
Untitled
0
When I run...
ls -r Request* | gawk-3.1.2 '
{
  title = ""
  pcmd="head " $0 " | grep \"<META REPORT-INFO=\""
  pcmd | getline title
  sub("^\\#", "", title)
  sub("<META REPORT-INFO=", "", title)
  sub(">", "", title)
  if(title == "") title = "Untitled"
 
  split($0, rr, "+")
  istxt = sub("\.t.t$", "", rr[7])  # rip ".t?t" off
  iscsv = sub("\.csv$", "", rr[7])  # rip ".csv" off
  if(iscsv) istxt=iscsv
 
  print title
  print istxt
 
}
'

I get the following output...
gawk-3.1.2: cmd. line:12: warning: escape sequence `\.' treated as plain `.'
TIIP Non-Payment Export
1
TIIP Batch Report
0

When I run...
ls -r Request* | gawk-3.1.2 '
{
  title = ""
  pcmd="head " $0 " | grep \"<META REPORT-INFO=\""
  pcmd | getline title
  sub("^\\#", "", title)
  sub("<META REPORT-INFO=", "", title)
  sub(">", "", title)
  if(title == "") title = "Untitled"
 
  split($0, rr, "+")
  istxt = sub("\\.t.t$", "", rr[7])  # rip ".t?t" off
  iscsv = sub("\\.csv$", "", rr[7])  # rip ".csv" off
  if(iscsv) istxt=iscsv
 
  print title
  print istxt
 
}
'

I get the following output...
TIIP Non-Payment Export
1
TIIP Batch Report
0

So I did find a work-around for it, but it initially broke some scripts.
 

 Scott J. Kast
 Database Administrator
 Bureau of Information Technology
 Pennsylvania Insurance Department
 E-mail: address@hidden

 

reply via email to

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