[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug in AWK
From: |
Evgeny Smirnov |
Subject: |
bug in AWK |
Date: |
Fri, 13 Aug 2021 23:30:07 +0300 |
Hello dear Sir or Madam,
It seems I’ve found a bug in awk.
The output is wrong depending on input data:
$ awk -f script.awk data.txt
1 ⨯
2016-09-04 20:14:29,20
2016-09-04 19:14:29,19
2016-09-04 20:14:29,19
/* here 20 should be instead of last 19 */
script.awk:
BEGIN{
OFS=","
}
{
"date -d \""$0"\" +%H" | getline d
print $0, d
}
data.txt:
2016-09-04 20:14:29
2016-09-04 19:14:29
2016-09-04 20:14:29
Best regards,
Evgeny Smirnov
- bug in AWK,
Evgeny Smirnov <=