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

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

User error or gawk bug?


From: Garrett Cooper
Subject: User error or gawk bug?
Date: Fri, 15 Jan 2010 13:00:07 -0800

Hi GNU folks,
   While testing out something to emulate $(abspath ) in GNU make
3.81+, I tried wrote the following in awk:

   gsub (/\/{2,}/, "")

   I expect it to squish all duplicate `/' in $0. Interestingly
enough, it doesn't match my expected behavior:

address@hidden ~]$ SLASHES="////////" ; test "$(echo "$SLASHES" |
awk '{ gsub (/\/{2,}/, ""); print }')" = "$SLASHES"; echo $?
0

   I've tried this same code on RHEL 4.6 (uses gawk), Gentoo Linux
(uses gawk), and my FreeBSD CURRENT box (uses nawk), and the results
are the same. So, my question is: did I do something wrong, or
accidentally stumble on an *awk bug?
Thanks!
-Garrett






reply via email to

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