# function like printf,in Bro language

**URL:** <https://community.zeek.org/t/function-like-printf-in-bro-language/272>\
**Category:** Zeek\
**Created:** [August 8, 2002, 2:34pm UTC](https://community.zeek.org/t/function-like-printf-in-bro-language/272 "2002-08-08T14:34:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaofu\_Wang](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Shaofu\_Wang](https://community.zeek.org/u/Shaofu_Wang)\
**Post date:** [August 8, 2002, 2:34pm UTC](https://community.zeek.org/t/function-like-printf-in-bro-language/272/1 "2002-08-08T14:34:50Z")

</div>

> \> printf("%s",demux\_dir);  
> [...]  
> \> Is there a function doing what does "printf" do ,in Bro language?
> 
> There is "fmt" which builds a string in a printf-like way (see the  
> "predefined functions" section in Bro's manual for details).
> 
> But for the case above, you don't need it actually:
> 
> &nbsp;&nbsp;&nbsp;&nbsp;print demux\_dir;
> 
> Robin

I want to put it to the screen. fmt can not do that . What should I do ?

---

<div class="post-metadata">

**Author:** ![Ruoming\_Pang1](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@Ruoming\_Pang1](https://community.zeek.org/u/Ruoming_Pang1)\
**Post date:** [August 8, 2002, 10:55pm UTC](https://community.zeek.org/t/function-like-printf-in-bro-language/272/2 "2002-08-08T22:55:27Z")

</div>

> \>There is "fmt" which builds a string in a printf-like way (see the  
> \>"predefined functions" section in Bro's manual for details).
> 
> I want to put it to the screen. fmt can not do that . What should I do ?

Either of following two ways will do:

print demux\_dir;

or

print fmt("%s", demux\_dir);

Ruoming

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:36pm UTC](https://community.zeek.org/t/function-like-printf-in-bro-language/272/3 "2022-05-06T15:36:33Z")

</div>


