bug-bash
[Top][All Lists]
Advanced

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

Re: Defect in manual section "Conditional Constructs" / case


From: Lawrence Velázquez
Subject: Re: Defect in manual section "Conditional Constructs" / case
Date: Tue, 24 Aug 2021 20:14:20 -0400
User-agent: Cyrus-JMAP/3.5.0-alpha0-1124-g8f1c7cb9de-fm-20210824.001-g8f1c7cb9

On Tue, Aug 24, 2021, at 4:44 PM, Dietmar P. Schindler wrote:
> Doesn't the example I gave above show that quotes are removed? If they
> weren't, how could word aa with pattern a""a constitute a match?

The quotes are handled by the matching process itself, *not* as
part of the usual shell expansions.  Otherwise these patterns would
be equivalent, but they're not.

% cat /tmp/foo.sh
case $1 in
    'a?a') echo one ;;
    a?a) echo two ;;
esac
% bash /tmp/foo.sh 'a?a'
one
% bash /tmp/foo.sh aaa
two


-- 
vq



reply via email to

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