It worked! sorry for noise, guys.
There was a silly mistake in my "sed" command: I should have given "-i
-c" to change the line in file. For the future ref., this is what it
should look like:

---------------------------------------------------------------
define env_check($file, $string, $swdir, $refreshonly = 'true') {
    $q_cmd = "/usr/bin/printenv | grep -F $swdir | cut -d= -f2"
    exec { 'chk_sw_dir':
        command  => "/bin/sed -i -c \"/$swdir/{s:$($q_cmd):$string:g}
\" '$file'",
        onlyif          => "$q_cmd | grep -vFxe '$string'",
        subscribe   => File['grid-env.sh'],
        refreshonly => $refreshonly,
    }
}
----------------------------------------------------------------

Cheers!!

Cheers!!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to