From: Brian Inglis <Brian.Inglis@Shaw.ca>
To: cygwin@cygwin.com
Subject: Re: cygcheck and literal plus sign
Date: Sat, 28 Jan 2017 19:59:00 -0000 [thread overview]
Message-ID: <492085c7-09c5-0c5b-8b6b-02f38a8df9a5@Shaw.ca> (raw)
In-Reply-To: <8ce40df2-0a8f-4128-9107-ea2f16ec7fca@redhat.com>
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
next prev parent reply other threads:[~2017-01-28 19:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-21 23:59 Steven Penny
2014-01-22 5:58 ` Christopher Faylor
2014-01-22 6:46 ` Marco Atzeri
2014-01-22 11:35 ` Andrew Schulman
2014-01-22 15:07 ` Christopher Faylor
2014-01-22 16:03 ` Andrew Schulman
2014-01-22 16:06 ` David Boyce
2014-01-22 16:13 ` Larry Hall (Cygwin)
2014-01-25 2:26 ` Steven Penny
2014-01-27 15:48 ` Gates, Roger
2014-01-27 18:59 ` Larry Hall (Cygwin)
2014-01-27 22:43 ` Steven Penny
2017-01-28 3:01 ` Steven Penny
2017-01-28 4:01 ` Doug Henderson
2017-01-28 12:21 ` Steven Penny
2017-01-28 17:45 ` Brian Inglis
2017-01-28 19:06 ` Eric Blake
2017-01-28 19:59 ` Brian Inglis [this message]
2017-01-30 18:30 ` Jon Turney
2017-01-31 0:00 ` Steven Penny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=492085c7-09c5-0c5b-8b6b-02f38a8df9a5@Shaw.ca \
--to=brian.inglis@shaw.ca \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).