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

[60au,w32] system() with tcsh

Expand Messages
  • Muraoka Taro
    $VIMRUNTIME/ftplugin/perl.vim has a problem. I use tcsh.exe for value of shell on W2K. Then perl.vim:36 system() is expanded as like below: c: bin tcsh.exe
    Message 1 of 4 , Sep 2, 2001
      $VIMRUNTIME/ftplugin/perl.vim has a problem.

      I use tcsh.exe for value of 'shell' on W2K.
      Then perl.vim:36 system() is expanded as like below:

      c:\bin\tcsh.exe -c "perl -e "print join(q/,/,@INC)" > c:\some_tmp_file"

      So quation is parsed by MSWindows as we didn't expect to,
      and it fail with error.
      When change the line like below, it works.
      But it not work for non-tcsh or other OS.

      let perlpath = system('perl -e \"print join(q/,/,@INC)\"')

      Probably we should add some filterling mechanism to os_win32.c,
      condition checker in perl.vim, or so.
      ----
      Muraoka Taro <koron@...>
    • Bram Moolenaar
      ... I can think of two alternatives: - Use a different shellxquote . Does using a single quote work? This should work in this case (there would be a problem
      Message 2 of 4 , Sep 3, 2001
        Muraoka Taro wrote:

        > $VIMRUNTIME/ftplugin/perl.vim has a problem.
        >
        > I use tcsh.exe for value of 'shell' on W2K.
        > Then perl.vim:36 system() is expanded as like below:
        >
        > c:\bin\tcsh.exe -c "perl -e "print join(q/,/,@INC)" > c:\some_tmp_file"
        >
        > So quation is parsed by MSWindows as we didn't expect to,
        > and it fail with error.
        > When change the line like below, it works.
        > But it not work for non-tcsh or other OS.
        >
        > let perlpath = system('perl -e \"print join(q/,/,@INC)\"')
        >
        > Probably we should add some filterling mechanism to os_win32.c,
        > condition checker in perl.vim, or so.

        I can think of two alternatives:

        - Use a different 'shellxquote'. Does using a single quote work? This
        should work in this case (there would be a problem when using an
        argument that includes a single quote then...).

        - Use single quotes in the system() call:

        let perlpath = system("perl -e 'print join(q/,/,@INC)'")

        The real solution would be that quotes inside 'shellxquote' are
        automatically escaped, but that is very complicated...

        --
        Be nice to your kids... they'll be the ones choosing your nursing home.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      • Muraoka Taro
        ... shellxquote is parsed by MSWindows, and MSWindows would accept only . So we can t use other character for it. ... Yes, it work fine. I made interim
        Message 3 of 4 , Sep 4, 2001
          > I can think of two alternatives:
          >
          > - Use a different 'shellxquote'. Does using a single quote work? This
          > should work in this case (there would be a problem when using an
          > argument that includes a single quote then...).

          'shellxquote' is parsed by MSWindows, and MSWindows would accept only '"'.
          So we can't use other character for it.

          > - Use single quotes in the system() call:
          >
          > let perlpath = system("perl -e 'print join(q/,/,@INC)'")

          Yes, it work fine.
          I made interim patch for ftplugin/perl.vim.
          Please check this.
          ----
          Muraoka Taro <koron@...>
        • Bram Moolenaar
          ... Looks OK to me. It s up to Dan Sharp to include this. -- Men may not be seen publicly in any kind of strapless gown. [real standing law in Florida, United
          Message 4 of 4 , Sep 4, 2001
            Muraoka Taro wrote:

            > > I can think of two alternatives:
            > >
            > > - Use a different 'shellxquote'. Does using a single quote work? This
            > > should work in this case (there would be a problem when using an
            > > argument that includes a single quote then...).
            >
            > 'shellxquote' is parsed by MSWindows, and MSWindows would accept only '"'.
            > So we can't use other character for it.
            >
            > > - Use single quotes in the system() call:
            > >
            > > let perlpath = system("perl -e 'print join(q/,/,@INC)'")
            >
            > Yes, it work fine.
            > I made interim patch for ftplugin/perl.vim.
            > Please check this.

            Looks OK to me. It's up to Dan Sharp to include this.

            --
            Men may not be seen publicly in any kind of strapless gown.
            [real standing law in Florida, United States of America]

            /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
            ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
            \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
          Your message has been successfully submitted and would be delivered to recipients shortly.