From owner-svn-src-all@FreeBSD.ORG Wed Nov 9 21:31:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FC7A1065672; Wed, 9 Nov 2011 21:31:29 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 0D3968FC12; Wed, 9 Nov 2011 21:31:29 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id D4DD0358C51; Wed, 9 Nov 2011 22:31:27 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id B098828468; Wed, 9 Nov 2011 22:31:27 +0100 (CET) Date: Wed, 9 Nov 2011 22:31:27 +0100 From: Jilles Tjoelker To: Alexey Dokuchaev Message-ID: <20111109213127.GB29992@stack.nl> References: <201111082302.pA8N2Wmj053356@svn.freebsd.org> <20111109014916.GA75862@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111109014916.GA75862@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227366 - in head/etc: . rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 21:31:29 -0000 On Wed, Nov 09, 2011 at 01:49:16AM +0000, Alexey Dokuchaev wrote: > On Tue, Nov 08, 2011 at 11:02:32PM +0000, Jilles Tjoelker wrote: > > Author: jilles > > Date: Tue Nov 8 23:02:32 2011 > > New Revision: 227366 > > URL: http://svn.freebsd.org/changeset/base/227366 > > Log: > > rc.d: Eliminate some unnecessary non-POSIX constructs: > > * ^ in character class > > - for file in ${dir}/[^0-9]*.sh; do > > + for file in ${dir}/[!0-9]*.sh; do > I don't have my copy of POSIX handy, but looking at SUSv2, circumflex `^' is > documented as non-matching list expression specifier, while `!' is not. > I am reading it wrong? Shell patterns are different from regular expressions. In SUSv4, XCU 2.13 Pattern Matching Notation describes shell patterns. In particular, the role of the '^' to negate a bracket expression is instead fulfilled by '!'; a '^' directly after the '[' produces unspecified results (so that the common RE-like behaviour is allowed). Historically, this is because the Bourne shell interprets '^' as a synonym for '|' (pipe) and therefore it cannot occur in a pattern unquoted. -- Jilles Tjoelker