I want to check if pattern exist in a file and then if it doesn;t echo the pattern in the file.
class environment { exec{'one_run': path=>'/usr/bin', command => "echo 'PATH=$PATH:/opt/logstash/bin' >> /etc/profile", onlyif => "grep -qFx 'PATH=$PATH:/opt/logstash/bin' /etc/profile", } } The above doesn't work,can anyone help with this please? I want to check if PATH=$PATH:/opt/logstash/bin' exists in /etc/profile and if not input it only once. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1b36ab52-29ee-455f-8efb-8d647fbd6c9c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.