1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#+begin_src cfengine3
bundle agent example_trim
# @brief Example showing string_trim
{
vars:
"my_string_one" string => string_trim( " Trim spaces please ");
"my_string_two" string => string_trim( "
Trim newlines also please
");
reports:
"my_string_one: '$(my_string_one)'";
"my_string_two: '$(my_string_two)'";
}
bundle agent __main__
{
methods: "example_trim";
}
###############################################################################
#+end_src
#+begin_src example_output
#@ ```
#@ R: my_string_one: 'Trim spaces please'
#@ R: my_string_two: 'Trim newlines also please'
#@ ```
#+end_src
|