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

Use and effect of shellquote and shellxquote

Expand Messages
  • esquifit
    According to :he shq Quoting character(s), put around the command passed to the shell, for the ! and :! commands. The redirection is kept outside of the
    Message 1 of 3 , Dec 3, 2012
    • 0 Attachment
      According to :he shq

      Quoting character(s), put around the command passed to the shell, for
      the "!" and ":!" commands. The redirection is kept outside of the
      quoting. See 'shellxquote' to include the redirection. It's
      probably not useful to set both options.

      What does this exactly means? I'm using gVim on Win7 with cygwin's
      bash as
      shell. I did the following trivial tests:
      1)
      :se shq=
      :se sqx=\"
      :!ls 2>&1
      Result: C:\Users\...\bash.exe -c "ls 2&>1"
      2)
      :se shq=\"
      :se sqx=
      :!ls 2>&1
      Result: C:\Users\...\bash.exe -c "ls 2&>1"

      That is, no difference in behaviour. I guess I'm misinterpreting the
      statement 'the redirection is kept outside of the quoting'.

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Ben Fritz
      ... The redirection referred to in the help is the automatic redirection added by Vim with shellredir (and maybe shellpipe , I m not sure), it has nothing
      Message 2 of 3 , Dec 3, 2012
      • 0 Attachment
        On Monday, December 3, 2012 11:49:35 AM UTC-6, esquifit wrote:
        > According to :he shq
        >
        >
        >
        > Quoting character(s), put around the command passed to the shell, for
        >
        > the "!" and ":!" commands. The redirection is kept outside of the
        >
        > quoting. See 'shellxquote' to include the redirection. It's
        >
        > probably not useful to set both options.
        >
        >
        >
        > What does this exactly means? I'm using gVim on Win7 with cygwin's
        >
        > bash as
        >
        > shell. I did the following trivial tests:
        >
        > 1)
        >
        > :se shq=
        >
        > :se sqx=\"
        >
        > :!ls 2>&1
        >
        > Result: C:\Users\...\bash.exe -c "ls 2&>1"
        >
        > 2)
        >
        > :se shq=\"
        >
        > :se sqx=
        >
        > :!ls 2>&1
        >
        > Result: C:\Users\...\bash.exe -c "ls 2&>1"
        >
        >
        >
        > That is, no difference in behaviour. I guess I'm misinterpreting the
        >
        > statement 'the redirection is kept outside of the quoting'.

        The redirection referred to in the help is the automatic redirection added by Vim with 'shellredir' (and maybe 'shellpipe', I'm not sure), it has nothing to do with stuff you type in the command line. Your entire typed command goes inside the shellxquote or shellquote regardless of whether you type special characters.

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • esquifit
        ... Thanks for the swift reply. I ve just read the help for shellredir and it makes sense. Now a related question. When should one use shellquote, when
        Message 3 of 3 , Dec 3, 2012
        • 0 Attachment
          On Monday, December 3, 2012 7:44:27 PM UTC+1, Ben Fritz wrote:
          > On Monday, December 3, 2012 11:49:35 AM UTC-6, esquifit wrote:
          > > According to :he shq
          > > Quoting character(s), put around the command passed to the shell,
          > > for
          > > the "!" and ":!" commands. The redirection is kept outside of the
          > > quoting. See 'shellxquote' to include the redirection. It's
          > > probably not useful to set both options.
          > > What does this exactly means?
          >
          > The redirection referred to in the help is the automatic redirection added
          > by Vim with 'shellredir' (and maybe 'shellpipe', I'm not sure), it has
          > nothing to do with stuff you type in the command line. Your entire typed
          > command goes inside the shellxquote or shellquote regardless of whether
          > you type special characters.

          Thanks for the swift reply. I've just read the help for shellredir and it
          makes sense.
          Now a related question. When should one use shellquote, when shellxquote?
          Why not both? ("it's probably not useful" sounds somewhat vague)

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        Your message has been successfully submitted and would be delivered to recipients shortly.