Re: [Puppet Users] Number of characters in string/variable

511 views
Skip to first unread message

Darren Chamberlain

unread,
Jul 9, 2012, 2:43:59 PM7/9/12
to puppet...@googlegroups.com
$ 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 <jkuskowski at benchmarklogic.com> [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 <dar...@boston.com>

jkuskowski

unread,
Jul 10, 2012, 10:51:44 AM7/10/12
to puppet...@googlegroups.com
Sweet thanks man!!!
Reply all
Reply to author
Forward
0 new messages