Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: L A Walsh Newsgroups: gnu.bash.bug Subject: Re: quote removal issues within character class Date: Sat, 09 Nov 2019 06:46:05 -0800 Lines: 27 Approved: bug-bash@gnu.org Message-ID: References: <16736.1573257142@jinx.noi.kre.to> <14879.1573303743@jinx.noi.kre.to> <5DC6D12D.6040900@tlinx.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1573310776 25991 209.51.188.17 (9 Nov 2019 14:46:16 GMT) X-Complaints-To: action@cs.stanford.edu Cc: =?UTF-8?B?T8SfdXo=?= , bug-bash@gnu.org To: Robert Elz Envelope-to: bug-bash@gnu.org User-Agent: Thunderbird In-Reply-To: <14879.1573303743@jinx.noi.kre.to> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 173.164.175.65 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <5DC6D12D.6040900@tlinx.org> X-Mailman-Original-References: <16736.1573257142@jinx.noi.kre.to> <14879.1573303743@jinx.noi.kre.to> Xref: csiph.com gnu.bash.bug:15583 On 2019/11/09 04:49, Robert Elz wrote: > There's also > > The special characters '.', '*', '[', and '\\' > (, , , and , > respectively) shall lose their special meaning within a bracket > expression. > ---- Is this really what the standard says, because '\\' is not a character, but 2 characters. They could use "\\" but if a backslash is between single quotes, it loses its special meaning. The only way to get a backslash when using single quotes that I've found is to end the single-quote then use the backslash. So if you wanted to insert single quotes in a string that is single-quoted, you would have to do this: 'this is a single-quote(SQ) quoted string using a SQ ('\'') within the single quote.' Alternatively using double-quotes or another quoting mechanism might be preferable. I find it odd that the standard would try to use a backslash within a SQ'd string as a literalizer.