From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 15 21:05:59 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54699106566B for ; Fri, 15 Jan 2010 21:05:59 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id 303A48FC14 for ; Fri, 15 Jan 2010 21:05:58 +0000 (UTC) Received: by pzk15 with SMTP id 15so852429pzk.3 for ; Fri, 15 Jan 2010 13:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=mC9ATC45Im9FoHKle2EeIWemCUh/qDs96J5oHfrx28U=; b=SHFg1O4cKWyduNhdo/yYOTLBGBGvSR69kh9BQ7wxzLjANl7+FS3GK1FOKvv8y9hR7i L1QZ0d8vMzZLwnOPefksirqhS3z7hyG5tGQZJ8omCPGELZCu1eq8GNIWlW7kSUYP5rSs P11I7HGxddA+99aKORsPC7HH7QLW7B2Q94ITM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=IZMxJCNPG7G2TTajosMiHi+ERlEFKQg9Z049PAt0TVJMN6f2MZS66v4mLpOY5bnVE6 7MphBOylheZW9ZqjgEQGjtYRc6NsmLaYxlrXFPTIFJ8HOHySIyrlX6W3U8E6riRtPZIg uLVAnXutuFsvYDQ+xVKYhnC4ckJ7H26N1Up3k= MIME-Version: 1.0 Received: by 10.142.61.38 with SMTP id j38mr1954954wfa.335.1263588108987; Fri, 15 Jan 2010 12:41:48 -0800 (PST) Date: Fri, 15 Jan 2010 12:41:48 -0800 Message-ID: <7d6fde3d1001151241tfeaa4a2j1c8448e40b2b164e@mail.gmail.com> From: Garrett Cooper To: FreeBSD-Hackers Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: User error or awk bug? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 21:05:59 -0000 Hi Hackers, 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: [gcooper@optimus ~]$ SLASHES="////////" ; test "$(echo "$SLASHES" | awk '{ gsub (/\/{2,}/, ""); print }')" = "$SLASHES"; echo $? 0 I've tried this same code on RHEL 4.6, Gentoo Linux, and of course my CURRENT box, and the results are the same. So, my question is: did I do something wrong, or accidentally stumble on an *awk bug? Thanks! -Garrett