[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: |
Pierre Gaston |
Subject: |
Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere. |
Date: |
Sat, 18 Sep 2010 08:19:12 +0300 |
On Sat, Sep 18, 2010 at 3:36 AM, Linda Walsh <bash@tlinx.org> wrote:
>
> ---
> If you would show me an example where pattern matching is
> disabled with ==, I might be more inclined to agree. But as I
> showed above, the pattern in $a matches regardless of double quoting.
glob="f??"
re="f.."
echo case:
case foo in
$glob) echo matches without quotes;;
*) echo do no match without quotes;;
esac
case foo in
"$glob") echo matches with quotes;;
*) echo do no match with quotes;;
esac
echo "= in [[ ]]"
if [[ foo = $glob ]]; then
echo matches without quotes
else
echo do no match without quotes
fi
if [[ foo = "$glob" ]]; then
echo matches with quotes
else
echo do no match with quotes
fi
echo "=~ in [[ ]]"
if [[ foo =~ $re ]]; then
echo matches without quotes
else
echo do no match without quotes
fi
if [[ foo =~ "$re" ]]; then
echo matches with quotes
else
echo do no match with quotes
fi
$ bash test/g
case:
matches without quotes
do no match with quotes
= in [[ ]]
matches without quotes
do no match with quotes
=~ in [[ ]]
matches without quotes
do no match with quotes
- Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., (continued)
- Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., Linda Walsh, 2010/09/21
- Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., Greg Wooledge, 2010/09/21
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Linda Walsh, 2010/09/22
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Dennis Williamson, 2010/09/22
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Marc Herbert, 2010/09/23
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Pierre Gaston, 2010/09/23
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Linda Walsh, 2010/09/23
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Pierre Gaston, 2010/09/24
Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., Linda Walsh, 2010/09/17
Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., Jan Schampera, 2010/09/18