bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFE: request for quotes as grouping operators to work in brackets as


From: Linda Walsh
Subject: Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere.
Date: Mon, 20 Sep 2010 12:28:14 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Thunderbird/2.0.0.24 Mnenhy/0.7.6.666



Pierre Gaston wrote:

Just quote the spaces and not the special chars:

Pierre, your suggestion doesn't help clean up strings used inside of double
brackets.  I wanted to avoid the need for multiple backslashes in an expression 
as it makes the expression less readable and more error prone.

Note that the same problem and solution exist when you use filename generation:

for f in /some path/ withspaces/*; do  # doesn't work the path contains spaces
----
        I'm aware of that, but since [[ and ]] are new, and =~ is new, there
is no legal interpretation for multiple arguments on either side of the =~
operator.

Since =~ permits comparing variables _without_ putting quotes around them,
(as would normally be the case if you used the single square brackets and
plain '='), why not extend that idea to not needing quotes between
the =~ and either side of the double square brackets so literal strings benefit from not needing quotes as well.

Of course, if quotes *are* included on the rhs, then the pattern matching
(glob or regex) would be disabled as happens now.

Is there a downside to this syntax or this idea?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]