###############################################################################
#+begin_src cfengine3
bundle agent main
# @brief Example illustrating the behavior of basename()
{
  vars:
    "basename" -> { "CFE-3196" }
      string => basename($(this.promise_filename));

    "basename_wo_extension" -> { "CFE-3196" }
      string => basename($(this.promise_filename), ".cf");

  reports:
    "basename = '$(basename)'";
    "basename without '.cf' extension = '$(basename_wo_extension)'";
}

#+end_src
###############################################################################
#+begin_src example_output
#@ ```
#@ R: basename = 'basename.cf'
#@ R: basename without '.cf' extension = 'basename'
#@ ```
#+end_example
