FAQ
I'm looking for a way to determine the number of characters in a
string/variable. I've tested some of the ruby length functions, but no
luck. Has anyone done this before?

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/BU0VlG7b3EIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Darren Chamberlain at Jul 9, 2012 at 6:44 pm
    $ cat var_l.pp
    $var = "i like pie"
    $var_l = inline_template("<%= var.length %>")
    notice("'$var' is $var_l characters long")

    $ puppet var_l.pp
    notice: Scope(Class[main]): 'i like pie' is 10 characters long

    * jkuskowski [2012/07/09 06:59]:
    I'm looking for a way to determine the number of characters in a
    string/variable. I've tested some of the ruby length functions, but no
    luck. Has anyone done this before?
    --
    Darren Chamberlain <darren@boston.com>

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Jkuskowski at Jul 10, 2012 at 2:51 pm
    Sweet thanks man!!!
    On Monday, July 9, 2012 2:43:59 PM UTC-4, Darren Chamberlain wrote:

    $ cat var_l.pp
    $var = "i like pie"
    $var_l = inline_template("<%= var.length %>")
    notice("'$var' is $var_l characters long")

    $ puppet var_l.pp
    notice: Scope(Class[main]): 'i like pie' is 10 characters long

    * jkuskowski [2012/07/09 06:59]:
    I'm looking for a way to determine the number of characters in a
    string/variable. I've tested some of the ruby length functions, but no
    luck. Has anyone done this before?
    --
    Darren Chamberlain <darren@boston.com>
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/rOJZ_u-85uEJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJul 9, '12 at 5:56p
activeJul 10, '12 at 2:51p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Jkuskowski: 2 posts Darren Chamberlain: 1 post

People

Translate

site design / logo © 2022 Grokbase