Hey Denmat Thanks for all your help but it seems that my little/no knowledge of ruby is creating a problem, I did what you suggested to get the following:
sh: Syntax error: word unexpected (expecting ")") Here is the code: require 'facter' Facter.add("envt") do setcode do %x{hostname.scan(/^\d+qa-/)}.chomp end end I tried to play around, changing sysntax, looked up google for syntax of ruby's scan function but no success and hence am bothering you again. Please help On Aug 25, 12:30 am, Denmat <tu2bg...@gmail.com> wrote: > Hi > > That was kind of pseudo code. In your example something like this: > > setcode do > %x{hostname}.scan(regex goes here) > end > > Den > > On 25/08/2011, at 15:52, newguy <aimanparv...@gmail.com> wrote: > > > > > > > > >>> setcode do > >>> %x{hostname -s|cut -c 1-2}.chomp -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.