diff --git a/cdist/conf/type/__ini_value/gencode-remote b/cdist/conf/type/__ini_value/gencode-remote index d110d2a9..dc6a0431 100755 --- a/cdist/conf/type/__ini_value/gencode-remote +++ b/cdist/conf/type/__ini_value/gencode-remote @@ -75,8 +75,8 @@ SHELL elif [ "$state_should" != "absent" ]; then # generate the indentation string spaces() { - _i=$1 - while [ $_i -gt 0 ]; do + _i="$1" + while [ "$_i" -gt 0 ]; do printf " " _i=$((_i - 1)) done @@ -88,10 +88,10 @@ SHELL delimiter="$(cat "$__object/parameter/delimiter")" value="$(cat "$__object/parameter/value")" indentation="$(cat "$__object/parameter/indentation" || true)" - i_indent="$(spaces $indentation)" + i_indent="$(spaces "$indentation")" delimiter_space="$(cat "$__object/parameter/delimiter-space" || true)" - i_del_space="$(spaces $delimiter_space)" - comment_sign="$(cat "$__object/parameter/comment-sign" | cut -c1)" + i_del_space="$(spaces "$delimiter_space")" + comment_sign="$(cut -c1 < "$__object/parameter/comment-sign")" # Generate a simple shell script which just generates the file printf "cat <<'FILE' > '%s'\n" "$file"