X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Thorsten Kampe <thorsten@thorstenkampe.de>
Subject:  Re: problem with globs using curly brackets and ^
Date:  Thu, 19 Apr 2007 15:28:25 +0100
Lines: 53
Message-ID: <f07uaa$5am$1@sea.gmane.org>
References:  <Pine.LNX.4.61.0704191531570.3988@ask.diku.dk>
Mime-Version:  1.0
Content-Type:  text/plain; charset="iso-8859-15"
Content-Transfer-Encoding:  7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

* Jens Rasmussen (Thu, 19 Apr 2007 15:34:17 +0200 (CEST))
> I'm having a problem with globs using curly brackets and ^.
> I've searched the web+forum with no luck, so I'm sorry if an answer 
> aleardy exists.

The answer is in the bash manual page. What has that got to do with 
Cygwin?!
 
> I've tried the commands on a linux environment and they worked fine + I've 
> read elsewhere that they should work in cygwin.
> So I assume that my config is wrong. I'm using bash 3.2.15(13)-release 
> (i686-pc-cygwin) and I've just updated all packages.
> 
> THE PROBLEM (using ls for illustration):
> 
> $ ls
> Desktop.ini  doc    optimering  test.txt
> bin          music  spaceninja
> 
> FOLLOWING WORKS:
> 
> $ ls -d {Desk*,doc*}
> Desktop.ini  doc

ls -d Desk* doc*
 
> BUT: (I assume that the following is because it normally makes no sense)
> 
> $ ls -d {Desk*}
> ls: cannot access {Desk*}: No such file or directory

ls -d Desk*
 
> AND: (my actual problem)
> 
> $ ls ^doc
> ls: cannot access ^doc: No such file or directory

"^" is only used in character ranges ("[^a-z]")
 
> $ ls -d ^{Desk*,doc*}
> ls: cannot access ^Desk*: No such file or directory
> ls: cannot access ^doc*: No such file or directory
> 
> - And yes, I'm a Linux/UNIX/Cygwin newb!

This has nothing to do with Linux nor UNIX nor Cygwin:

$ shopt -s extglob
$ echo !(Desk*|doc*)


Thorsten


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

