# Read stdout to a variable

**URL:** <https://www.finalbuilder.com/forums/t/read-stdout-to-a-variable/5193>\
**Category:** Discussion\
**Created:** [July 2, 2014, 12:13pm UTC](https://www.finalbuilder.com/forums/t/read-stdout-to-a-variable/5193 "2014-07-02T12:13:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitro76](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@mitro76](https://www.finalbuilder.com/forums/u/mitro76)\
**Post date:** [July 2, 2014, 12:13pm UTC](https://www.finalbuilder.com/forums/t/read-stdout-to-a-variable/5193/1 "2014-07-02T12:13:14Z")

</div>

Hi,  
  
is there any possibility to read the stdout of a commandline application to a variable?  
  
Thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [July 3, 2014, 6:59am UTC](https://www.finalbuilder.com/forums/t/read-stdout-to-a-variable/5193/2 "2014-07-03T06:59:18Z")

</div>

Hi Micheal,  
  
Currently we don’t have any way to do this within Continua. If you have FinalBuilder, you can create a FinalBuilder project to run the command line, log the output to a variable then set the Continua variable. This can then be run from a FinalBuilder action in Continua.

---

<div class="post-metadata">

**Author:** ![mitro76](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@mitro76](https://www.finalbuilder.com/forums/u/mitro76)\
**Post date:** [July 4, 2014, 1:08am UTC](https://www.finalbuilder.com/forums/t/read-stdout-to-a-variable/5193/3 "2014-07-04T01:08:47Z")

</div>

So there is no way to set the build number from values in the sources without using FB?   
 I want to set the build no to the application version. And it is stored in the repository.

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [July 4, 2014, 2:09am UTC](https://www.finalbuilder.com/forums/t/read-stdout-to-a-variable/5193/4 "2014-07-04T02:09:52Z")

</div>

Hi Micheal,  
  
You can write [custom log messages](http://wiki.finalbuilder.com/x/BoBU) to stdout&nbsp;from a program or batch file. See the following batch file example;

`@echo 9.9.9.9>version.txt`

`@for /f %%x in (version.txt) do set BuildVersion=%%x`

`@echo @@continua[setVariable name=‘BuildVersion’ value=’%BuildVersion%’]`

`@echo @@continua[setBuildVersion value=’%BuildVersion%’]`

  
  
The GitVersion tool communicates with Continua in this way. See [https://github.com/Particular/GitVersion/blob/master/GitVersionCore/BuildServers/ContinuaCi.cs](https://github.com/Particular/GitVersion/blob/master/GitVersionCore/BuildServers/ContinuaCi.cs)&nbsp;
