Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5878

startGroovy breaks one-liners containing double quotes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.1.0-rc-2, 2.1.0, 2.0.7
    • None
    • Windows/Cygwin; probably all versions affected
    • Patch

    Description

      The issue was raised in this groovy-user discussion:

      http://groovy.329449.n5.nabble.com/How-to-properly-escape-groovy-one-liners-for-bash-tp5712274.html

      The following statement is supposed to throw a MultipleCompilationErrorsException but instead if gives "bad substitution" message from the shell:

      groovy -e 'println "${a.author}"'

      The problem is that on Cygwin the startGroovy script does additional processing that breaks some code that is given as an argument to the '-e' option.

      The attached patch fixes this problem if the Bash is used, which in all reasonable conditions seems to be the case.

      Attachments

        1. startGroovy.patch
          2 kB
          Volker Börchers

        Activity

          People

            paulk Paul King
            boercher Volker Börchers
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: