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