X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 16 Sep 2010 11:24:58 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: awk gsub problem Message-ID: <20100916092458.GB15121@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Sep 15 18:30, Lee wrote: > I don't know if this is just a problem with the cygwin version of awk, > me misunderstanding something or what, but it looks like gsub isn't > working correctly in awk: > $ sh /tmp/test.awk > s= ::0:: should = ::S0:: > > $ cat /tmp/test.awk > awk ' > BEGIN { > s="Serial0" > gsub("[a-z]","",s) > printf("s= ::%s:: should = ::S0::\n", s) > exit > } ' > > > I also tried it with IGNORECASE=0 and with "awk --traditional" - same results. > > $ which awk > /usr/bin/awk > > $ awk --version > GNU Awk 3.1.8 Works fine for me: $ uname -a CYGWIN_NT-6.1 vmbert7 1.7.7(0.230/5/3) 2010-08-31 09:58 i686 Cygwin $ gawk --version GNU Awk 3.1.8 Copyright (C) 1989, 1991-2010 Free Software Foundation. [...] $ sh //calimero/corinna/test.awk s= ::S0:: should = ::S0:: $ Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple