Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.programmer > #5163

Re: Which content should be escaped?

From Markus Elfring <Markus.Elfring@web.de>
Newsgroups comp.unix.programmer
Subject Re: Which content should be escaped?
Date 2014-03-03 10:30 +0100
Message-ID <bnj0e3Fft17U1@mid.individual.net> (permalink)
References <bngoc5F196mU1@mid.individual.net> <20140302095342.219@kylheku.com> <531381A4.1020704@web.de> <20140302122038.693@kylheku.com>

Show all headers | View raw


> We have to trade one form escaping instead of another, but the escaping we have
> to do now is in the body of the static template, to ensure it is a valid
> here-doc, not in the variable being substituted, which has "wild and wooly"
> run-time contents.
> 
> The template is more "static" relative to the contents of the wild and wooly
> variable being substituted. We can just write the template correctly by hand,
> and that's it.

I would agree to your advice in the general situation. The simple test data I
started the clarification with fits to your view.

But I find that the real template files have got such constraints that the
here-document rules are not useful there.


> (By the way, in a here doc template have to watch out not only for unintended
> variable substitutions due to stray dollar signs and some other things like
> backslashes or the coincidental occurence of the EOF marker.)

Your hint is very interesting because it points some implementation details out
for further consideration in the involved software design. I prefer to adjust
the replacement text for my concrete use case.

Regards,
Markus

Back to comp.unix.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-02 14:00 +0100
  Re: Escaping of line breaks for text replacement jt@toerring.de (Jens Thoms Toerring) - 2014-03-02 15:49 +0000
    Re: Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-03 08:38 +0100
  Re: Escaping of line breaks for text replacement dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-02 16:52 +0000
    Re: Escaping of line breaks for text replacement Kaz Kylheku <kaz@kylheku.com> - 2014-03-02 17:53 +0000
      Re: Escaping of line breaks for text replacement Kaz Kylheku <kaz@kylheku.com> - 2014-03-02 20:27 +0000
        Re: Escaping of line breaks for text replacement dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-03 16:17 +0000
          Re: Escaping of line breaks for text replacement Kaz Kylheku <kaz@kylheku.com> - 2014-03-03 17:44 +0000
            Re: Escaping of line breaks for text replacement Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2014-03-04 13:30 +0000
    Re: Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-02 20:50 +0100
      Re: Escaping of line breaks for text replacement dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-03 16:52 +0000
    Re: Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-03 09:24 +0100
    Re: Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-03 12:55 +0100
      Re: Escaping of line breaks for text replacement dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-03 17:02 +0000
        Re: Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-06 12:02 +0100
          Re: Escaping of line breaks for text replacement dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-06 18:51 +0000
            Re: Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-06 20:48 +0100
              Re: Escaping of line breaks for text replacement dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-06 22:59 +0000
                Re: Escaping of line breaks for text replacement Kaz Kylheku <kaz@kylheku.com> - 2014-03-07 06:38 +0000
                Re: Escaping of line breaks for text replacement Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-07 13:33 +0000
                Re: Escaping of line breaks for text replacement dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-07 15:08 +0000
                Re: Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-07 11:23 +0100
                Re: Escaping of line breaks for text replacement dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-07 14:43 +0000
                Re: Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-07 17:23 +0100
                Re: Escaping of line breaks for text replacement dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-07 19:53 +0000
                Bash 4.3.0 escape expansion (was: Re: Escaping of line breaks for text replacement) dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-08 12:26 +0000
                Re: Bash 4.3.0 escape expansion (was: Re: Escaping of line breaks for text replacement) Kaz Kylheku <kaz@kylheku.com> - 2014-03-08 20:05 +0000
                Re: Bash 4.3.0 escape expansion Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-09 03:48 +0000
                Re: Bash 4.3.0 escape expansion dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-09 13:21 +0000
  Re: Escaping of line breaks for text replacement Kaz Kylheku <kaz@kylheku.com> - 2014-03-02 18:11 +0000
    Re: Escaping of line breaks for text replacement Markus Elfring <Markus.Elfring@web.de> - 2014-03-02 20:08 +0100
      Re: Escaping of line breaks for text replacement Kaz Kylheku <kaz@kylheku.com> - 2014-03-02 20:35 +0000
        Re: Which content should be escaped? Markus Elfring <Markus.Elfring@web.de> - 2014-03-03 10:30 +0100
          Re: Which content should be escaped? dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2014-03-04 14:04 +0000
            Re: Which content should be escaped? Kaz Kylheku <kaz@kylheku.com> - 2014-03-04 17:32 +0000
  Re: Escaping of line breaks for text replacement Siri Cruz <chine.bleu@yahoo.com> - 2014-03-07 02:47 -0800

csiph-web