dheule wrote on 02/27/2014 09:21 AM:
>> +$(cat "$__object/parameter/comment_line")
>> +__CDIST_INPUT_END_HERE_MARKER
>> +)"
>> +
>> +tmpfile=\$(mktemp "${file}.cdist.XXXXXXXXXX")
>> +# preserve ownership and permissions by copying existing file over tmpfile
>> +cp -p "$file" "\$tmpfile"
>> +awk -f - "$file" >"\$tmpfile" <<"AWK_EOF"
>> +BEGIN {
>> +    # import variables in a secure way ..
>> +    state=ENVIRON["state"]
>> +    key=ENVIRON["key"]
>> +    delimiter=ENVIRON["delimiter"]
>> +    value=ENVIRON["value"]
>> +    comment=ENVIRON["comment"]
>> +    keydel=key delimiter
>
> Yep, this is so,
>
> But the orginal sed:
>
> sed "s|^$key\($delimiter\+\).*|$key\\1$value_escaped|" "$file" > "\$tmpfile"
>
> only takes care about the count of the delimiter, but not explicit for
> whitespaces ...

You are right again. Hmm, I was pretty sure I had coded that differently 
at some point. Sorry about the noise.