Is it possible to count the lines returned in stdout using InstallBuilder's regular expressions?


asked 21 Mar '12, 11:49

wildcatz's gravatar image

accept rate: 0%

You could use the below code:

<setInstallerVariable name="number" value="1"/>
           <text>${number} + 1</text>

Please note that any double backslashes should be converted to single backslashes.


answered 21 Mar '12, 12:51

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

thanks, but that doesn't work for me. I don't get anything.

(21 Mar '12, 13:04) wildcatz

Looks like with double slashes, if never enters the while. I took out one of the double slashes where they occur, and now it never exits.

I've been banging my head against this for a day now - surely this should be easier than this?!

(21 Mar '12, 13:45) wildcatz

really need some help here! Anyone know how this can be done / fixed?

(21 Mar '12, 20:27) wildcatz

Could you paste the sample text you are using? Also, have you removed the double slashes in the while condition too? (They are automatically added by the form, we will investigate how to solve it)

(22 Mar '12, 04:10) juanjo ♦♦

I have updated the XML above and I have verified it to work properly.

(22 Mar '12, 05:14) wojciechka ♦♦

it works with these changes - I must have missed something. Thanks.

(22 Mar '12, 20:48) wildcatz
showing 5 of 6 show all

If you just need that on Unix, you could call wc:

    <execArgs>"${program_stdout}" | wc -l</execArgs>

answered 22 Mar '12, 04:24

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

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]( "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: 21 Mar '12, 11:49

Seen: 1,902 times

Last updated: 22 Mar '12, 20:48