From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108636 invoked by alias); 28 Jan 2017 19:59:17 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 108625 invoked by uid 89); 28 Jan 2017 19:59:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=calgary, Alberta, alberta, Calgary X-HELO: smtp-out-no.shaw.ca Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 28 Jan 2017 19:59:15 +0000 Received: from [192.168.1.100] ([174.0.238.184]) by shaw.ca with SMTP id XZ9UcwMHcVQuxXZ9VcdT74; Sat, 28 Jan 2017 12:59:13 -0700 X-Authority-Analysis: v=2.2 cv=BNTDlBYG c=1 sm=1 tr=0 a=WqCeCkldcEjBO3QZneQsCg==:117 a=WqCeCkldcEjBO3QZneQsCg==:17 a=vsAZ4HiF_gUA:10 a=IkcTkHD0fZMA:10 a=lq09YCyhELUA:10 a=0a-MxDs-DqgJ-4PeFYMA:9 a=QEXdDO2ut3YA:10 Reply-To: Brian.Inglis@Shaw.ca Subject: Re: cygcheck and literal plus sign References: <588c8cc9.a5249d0a.d8d5b.49c2@mx.google.com> <8ce40df2-0a8f-4128-9107-ea2f16ec7fca@redhat.com> To: cygwin@cygwin.com From: Brian Inglis Message-ID: <492085c7-09c5-0c5b-8b6b-02f38a8df9a5@Shaw.ca> Date: Sat, 28 Jan 2017 19:59:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <8ce40df2-0a8f-4128-9107-ea2f16ec7fca@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfNnoI7JWi2dauxyqLHb4OWX+TPU/0CFgCkreT3ll4t5xtB0dT+uTit7eeLtnuxC3vfUy26Pytl8T5UGtJiqsunWX7tmjSr1GLEx7zO28xwCdlBbHJ9S/ ja4QEJJM/M1tsiWpRR6pct+tfLj3G9ouDrwGtTqzP7RJ77BZ3OOj1yHH X-SW-Source: 2017-01/txt/msg00357.txt.bz2 On 2017-01-28 12:06, Eric Blake wrote: > On 01/28/2017 11:45 AM, Brian Inglis wrote: >>> it did put me on the right track: >>> $ cygcheck -p 'mingw32-g[:punct:][:punct:]' | awk 'NR>1{$0=$1}1' >> Your command is the same as: >> $ cygcheck -p mingw32-g[:ctnpu][:ctnpu] | sed '2,$s/\s.*//' > Not necessarily. You forgot quotes, so depending on what is in your > current directory, that glob might expand. The point was that in any case it was not doing what was wanted nor expected, and an extra set of brackets [[:punct:]] are needed to search for punctuation. >> ITYM: >> $ cygcheck -p mingw32-g[[:punct:]][[:punct:]] | sed '2,$s/\s.*//' Not sure what if anything glob does with double brackets - anything I tried with ls always returned the search string e.g. $ ls /etc/setup/[[a-z]]* ls: cannot access '/etc/setup/[[a-z]]*': No such file or directory It does not seem to have any support for accented character classes or the ilk e.g. re [[:a:][:e:][:i:][:o:][:u:]] which could be useful searching for UTF-8 filenames. > Or, with proper quoting to shield yourself from globbing based on the > contents of the current directory: > cygcheck -p 'mingw32-g[[:punct:]][[:punct:]]' | sed '2,$s/\s.*//' Always a concern for conscientious scripters and especially on Windows where characters which may rarely be encountered on Unix systems are often lurking to catch unwary scripters. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- 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