From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15075 invoked by alias); 7 May 2015 15:53:40 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20187 Received: (qmail 5124 invoked from network); 7 May 2015 15:53:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-f794b6d000001495-51-554b8a738fc3 Date: Thu, 07 May 2015 16:52:50 +0100 From: Peter Stephenson To: Zsh Users Subject: Re: Some problems with recursive globbing Message-id: <20150507165250.18184e1a@pwslap01u.europe.root.pri> In-reply-to: References: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsVy+t/xK7rFXd6hBgtem1jsOLmS0YHRY9XB D0wBjFFcNimpOZllqUX6dglcGRfm3WUr+MdWcXvDIfYGxiOsXYycHBICJhJH5u5gg7DFJC7c Ww9kc3EICSxllJh/vZMZwpnGJLFg70YmCGcro8TeNRMZQVpYBFQlViw5AGazCRhKTN00G8wW EVCUOPPrG1ADB4ewgJHEoiUBIGFeAXuJ839fMoOEOQWCJe5ucQIJCwkESNw9uBfsIH4BfYmr fz8xQRxkLzHzyhlGiFZBiR+T77GA2MwC6hKT5i1ihrC1JZ68u8AKMUdd4sbd3ewTGIVmIWmZ haRlFpKWBYzMqxhFU0uTC4qT0nON9IoTc4tL89L1kvNzNzFCQvbrDsalx6wOMQpwMCrx8K6w 8w4VYk0sK67MPcQowcGsJMLL2gYU4k1JrKxKLcqPLyrNSS0+xCjNwaIkzjtz1/sQIYH0xJLU 7NTUgtQimCwTB6dUA2Poq/NhJ1pf9UbPZr9g+5+vXfG+4kf7XWdvzS3xU8u/9S5w+k2rT5lW mS2bizd4//vSt3G61VYfNaF/y+fWTq6J3Hp57RdVVT/ew4u71vklCDfWG7pclTt/I5blwYbC 1DcCgicUvKQMDximJHJLlZ2x/XEv7r39JAFbfzZ/cx2+1y/OPt7+1keJpTgj0VCLuag4EQDU vLbFVQIAAA== On Thu, 7 May 2015 16:35:57 +0200 Jesper Nyg=C3=A5rds wrote: > Question: I found it surprisingly difficult to to find a glob pattern that > excluded target directories and their contents at all levels. Have I > complicated this too much, is there an easier way to express this glob? Yes, you can use '(^target/)#'. Note also that after "~" is just a pure pattern --- / isn't special. So if you had to exclude explicitly as /target/ or target/ or /target you'd use ~(|*/)target(|*/) > Problem: I can't get this to work for both cases of a) directories with > spaces in their names and b) directories with parenthesis in their names Native zsh options are *supposed* to be set up to be insensitive to this sort of nonsense... Try putting emulate -L zsh as the first line of your function. I may have missed something more subtle. pws