Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15583 > unrolled thread
| Started by | L A Walsh <bash@tlinx.org> |
|---|---|
| First post | 2019-11-09 06:46 -0800 |
| Last post | 2019-11-09 06:46 -0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: quote removal issues within character class L A Walsh <bash@tlinx.org> - 2019-11-09 06:46 -0800
| From | L A Walsh <bash@tlinx.org> |
|---|---|
| Date | 2019-11-09 06:46 -0800 |
| Subject | Re: quote removal issues within character class |
| Message-ID | <mailman.1108.1573310775.13325.bug-bash@gnu.org> |
On 2019/11/09 04:49, Robert Elz wrote:
> There's also
>
> The special characters '.', '*', '[', and '\\'
> (<period>, <asterisk>, <left-square-bracket>, and <backslash>,
> 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.
Back to top | Article view | gnu.bash.bug
csiph-web