#365193 bash: backslash quoting rules is too technical. Please provide examples

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Jari Aalto
Date:
2021-09-22 04:43:56 UTC
Severity:
minor
#365193#5
Date:
2006-04-28 12:39:40 UTC
From:
To:
Basch manual reads:

   QUOTING
       Quoting is used to remove the special meaning of certain characters  or
       ...

       Enclosing  characters  in  double quotes preserves the literal value of
       all characters within the quotes, with the exception of $, `,  \,  and,
       when  history  expansion  is enabled, !.  The characters $ and ` retain
       their special meaning within double quotes.  The backslash retains  its
       special  meaning only when followed by one of the following characters:
       $, `, ", \, or <newline>.  A double quote may be quoted  within  double
       quotes by preceding it with a backslash.  If enabled, history expansion
       will be performed unless an !  appearing in double  quotes  is  escaped
       using a backslash.  The backslash preceding the !  is not removed.

This chapter is packed with information and very, very difficult to
read or understand properly. Furthermore the case of (!) is really not
ironed out well, because it is also used for history mechanism.

See bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=135402 (archived)

which demonstrates just how difficult it is to treat ! character
properly. This should be better documented. Consider using the bug's
as a base for improving the manual.

SUGGESTION

Add clarifying examples to demonstrate the quoting rules for these special
characters mentioned ($ ` " \ !)

#365193#10
Date:
2006-04-28 13:43:21 UTC
From:
To:
                                                          ^^^^^^
							 escaped?
I didn't find it to be that bad.  Well, the language is actually quite
good, even if posix sh is quirky..
Isn't that the whole problem?  There are an entire 2 sentences devoted
to this :)
Perhaps by a boldface in the existing phrase?

  The backslash preceding the !  is \fBnot\fP removed.
I think it is clear how, at least, the first 4 work.

I would suggest the 2 changes: s/quoted/escaped/, and boldfacing of
"not".

Justin

#365193#15
Date:
2006-05-03 14:18:29 UTC
From:
To:
| On Fri, Apr 28, 2006 at 03:39:40PM +0300, Jari Aalto wrote:
| > Package: bash
| > Version: 3.1-4
| > Severity: minor
| >
| > Basch manual reads:
| >
| >    QUOTING
| >        Quoting is used to remove the special meaning of certain characters  or
| >        ...
| >
| >        Enclosing  characters  in  double quotes preserves the literal value of
| >        all characters within the quotes, with the exception of $, `,  \,  and,
| >        when  history  expansion  is enabled, !.  The characters $ and ` retain
| >        their special meaning within double quotes.  The backslash retains  its
| >        special  meaning only when followed by one of the following characters:
| >        $, `, ", \, or <newline>.  A double quote may be quoted  within  double
|                                                           ^^^^^^
| 							 escaped?
|
| >        quotes by preceding it with a backslash.  If enabled, history expansion
| >        will be performed unless an !  appearing in double  quotes  is  escaped
| >        using a backslash.  The backslash preceding the !  is not removed.
| >
| > This chapter is packed with information and very, very difficult to
| > read or understand properly.
|
| I didn't find it to be that bad.  Well, the language is actually quite
| good, even if posix sh is quirky..
|
| > Furthermore the case of (!) is really not ironed out well, because
| > it is also used for history mechanism.
|
| Isn't that the whole problem?  There are an entire 2 sentences devoted
| to this :)
|
| > which demonstrates just how difficult it is to treat ! character
| > properly. This should be better documented.
|
| Perhaps by a boldface in the existing phrase?
|
|   The backslash preceding the !  is \fBnot\fP removed.
|
| > Add clarifying examples to demonstrate the quoting rules for these special
| > characters mentioned ($ ` " \ !)
|
| I think it is clear how, at least, the first 4 work.
| I would suggest the 2 changes: s/quoted/escaped/, and boldfacing of
| "not".

This is not sufficient. For anyone else than native, tech savvy
programmer, the chapter may be "clear enough", but please provide
clarifying examples. This really calls for them, need them as
described in the bug report mentioned earlier. Those visual examples
make it clear, whereas the text stays obscured after reading and
reading when one has to "translate" meaningg of those word into
one's own native language.

Pictures do not suffer from language barries that much. Exmaples
even less.

Jari

#365193#20
Date:
2021-09-22 04:26:15 UTC
From:
To:
Hello,

Good morning,

We have gone through your samples from a partner and Here is our  Order
List. Please do bear in mind that we are very much in  need of this
order, quote your competitive prices.

Kindly send the Order confirmation.

Your early reply will be much appreciated.

Best Regards,

Maryanah Erwin.

PT FINDORA INTERNUSA

Jln Pahlawan 66 Kec. Arjawinangun

45162 CIREBON West-Java INDONESIA

tel : +62 231 357334

fax: +62 231 357260

email: marketing@findora.com