Forum: CFEngine Help
Subject: Re: How to add to line with field_edits?
Author: marc
Link to topic: https://cfengine.com/forum/read.php?3,22981,22989#msg-22989

I have used this in a other promise. And it works like a charm :-)

But is there no way to loop over a slist. And send my position in the loop and 
the string from that position to my "edit_field col()" like?


bundle edit_line check_and_replace(match,fields)
{                                 
field_edits:                      
        "$(match).*"              
                edit_field => col(" 
","$(fields_loop_nr)","$(fields_string_at_loop_nr)","set")                      
                                                                                
                
}                                                                               
                                                                              

body edit_field col(split,col,newval,method)                                    
                                                                              
{                                                                               
                                                                              
field_separator => "$(split)";                                                  
                                                                              
select_field    => "$(col)";                                                    
                                                                              
value_separator  => ",";
field_value     => "$(newval)";                                                 
                                                                              
field_operation => "$(method)";
extend_fields => "true";                                                        
                                                                              
}


_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to