Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-552

Lost $ within literal blocks when not followed by alpha

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Windows XP or Solaris, JDK 1.4.2_10

      Description

      This is probably the same root cause as #355 (lost #s).
      I was happy to find the #literal() directive in the user guide, because I intend to output SH script from Velocity, which could otherwise get messy. Unfortunately, under certain circumstances, $s are being gobbled.
      Consider this VTL fragment:
      #literal()
      export $VAR=$(echo $testme)
      #end

      Run through evaluate, this spits out
      export $VAR=(echo $testme)

      which isn't very literal (and is a compilation fault in SH). Even more odd,
      #literal()
      export $VAR=\$(echo $testme)
      #end

      outputs
      export $VAR=(echo $testme)

      Did some further testing on it, and if the $ isn't followed by alpha, it gets gobbled, but only inside a literal block.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dtertman Dan Ertman
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: