diff --git a/cdist/conf/type/__key_value/gencode-remote b/cdist/conf/type/__key_value/gencode-remote index 1e1d7c92..62cc745d 100755 --- a/cdist/conf/type/__key_value/gencode-remote +++ b/cdist/conf/type/__key_value/gencode-remote @@ -80,30 +80,27 @@ case "$state_should" in esac cat <<__CDIST_HEREDOC_END_HERE_MARKER -export state="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER" +IFS='\n' read -r state <<'__CDIST_INPUT_END_HERE_MARKER' $state_should __CDIST_INPUT_END_HERE_MARKER -)" -export key="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER" +export state +IFS='\n' read -r key <<'__CDIST_INPUT_END_HERE_MARKER' $key __CDIST_INPUT_END_HERE_MARKER -)" -export value="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER" +export key +IFS='\n' read -r value <<'__CDIST_INPUT_END_HERE_MARKER' $(cat "$__object/parameter/value") __CDIST_INPUT_END_HERE_MARKER -)" -export delimiter="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER" +export value +IFS='\n' read -r delimiter <<'__CDIST_INPUT_END_HERE_MARKER' $(cat "$__object/parameter/delimiter") __CDIST_INPUT_END_HERE_MARKER -)" -export exact_delimiter="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER" -$exact_delimiter -__CDIST_INPUT_END_HERE_MARKER -)" -export comment="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER" +export delimiter +IFS='\n' read -r comment <<'__CDIST_INPUT_END_HERE_MARKER' $(cat "$__object/parameter/comment") __CDIST_INPUT_END_HERE_MARKER -)" +export comment +export exact_delimiter="$exact_delimiter" tmpfile=\$(mktemp "${file}.cdist.XXXXXXXXXX") # preserve ownership and permissions by copying existing file over tmpfile