I need to read and display the text of a shell script that contains shell variables e.g. the line:

p=`dirname ${0}`

My InstallBuilder script looks like this:


InstallBuilder obviously evaluates the file text for <showText> e.g. the variable ${0} which does of course not exist. So the above line is displayed as

p=`dirname ***unknown variable 0***`

Is it possible to display the text as plain text without InstallBuilder trying to evaluate variables in the text?

asked 05 Jul '12, 05:50

twiga's gravatar image

accept rate: 0%

This is a current limitation. You could use the below custom action, and use <readFileEscapeVars> instead of <readFile>:

          <globalVariables names="${variable}"/>
          <createTimeStamp variable="timestamp"/>
          <setInstallerVariable name="tmpFile" value="${system_temp_directory}/tmp-${timestamp}.txt"/>
          <copyFile origin="${file}" destination="${tmpFile}"/>
              <substitution pattern="${" value="@@DOLLAR_CHAR@@{"/>
          <readFile name="${variable}" path="${tmpFile}"/>
          <deleteFile path="${tmpFile}"/>
          <stringParameter name="file" value="" default=""/>
          <stringParameter name="variable" value="" default=""/>
        <readFileEscapeVars file="${filePath}" variable="file_content"/>

answered 05 Jul '12, 07:14

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

Thank you Juanjo, that's awesome and works like a charm.

(05 Jul '12, 09:12) twiga
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 05 Jul '12, 05:50

Seen: 1,422 times

Last updated: 05 Jul '12, 09:12