Date: Wed, 9 Nov 2011 22:31:27 +0100 From: Jilles Tjoelker <jilles@stack.nl> To: Alexey Dokuchaev <danfe@FreeBSD.org> 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 Message-ID: <20111109213127.GB29992@stack.nl> In-Reply-To: <20111109014916.GA75862@FreeBSD.org> References: <201111082302.pA8N2Wmj053356@svn.freebsd.org> <20111109014916.GA75862@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111109213127.GB29992>