Loading ...
Sorry, an error occurred while loading the content.

Expand Messages
  • Dave Silvia
    Why does appear to be the only valid method of using ? echomsg Hello gives ^@Hello^@^@ Which is what you d expect, and echo
    Message 1 of 2 , Aug 1, 2004
    • 0 Attachment
      Why does "\<NL>" appear to be the only valid method of using <NL>?

      echomsg "\<NL>Hello\<NL>\<NL>"
      gives
      ^@Hello^@^@
      Which is what you'd expect, and
      echo "\<NL>Hello\<NL>\<NL>"
      gives

      Hello

      Again what you'd expect. But
      echomsg '<NL>Hello\<NL>\\<NL>'
      gives
      <NL>Hello\<NL>\\<NL>
      as does echo of the same?? There doesn't seem to be any combination of
      backslash escaping or not that works in single quotes.

      I'm sure there's some basic principal I'm just not seeing.

      TIA,
      Dave S.
    • Tofer Chagnon
      On Sun, 1 Aug 2004 22:28:57 -0500, Dave Silvia wrote: [snip] ... Dave, ... literal-string *literal-string* *E115* ... string
      Message 2 of 2 , Aug 2, 2004
      • 0 Attachment
        On Sun, 1 Aug 2004 22:28:57 -0500, Dave Silvia <dsilvia@...> wrote:

        [snip]

        > echomsg '<NL>Hello\<NL>\\<NL>'
        > gives
        > <NL>Hello\<NL>\\<NL>
        > as does echo of the same?? There doesn't seem to be any combination of
        > backslash escaping or not that works in single quotes.
        >

        Dave,

        Single quotes are used to delimit a literal string:

        :h literal-string

        literal-string *literal-string* *E115*
        ---------------
        'string' literal string constant *expr-'*

        Note that single quotes are used.

        This string is taken literally. No backslashes are removed or have a special
        meaning. A literal-string cannot contain a single quote. Use a normal string
        for that.

        HTH,

        Tofer
      Your message has been successfully submitted and would be delivered to recipients shortly.