forked from ungleich-public/cdist
add a hopefully more robust implementation for changing existing values
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
23eba4c5e1
commit
85f7880c7e
1 changed files with 1 additions and 4 deletions
|
@ -40,10 +40,7 @@ DONE
|
||||||
else
|
else
|
||||||
# change value
|
# change value
|
||||||
cat << DONE
|
cat << DONE
|
||||||
awk -F "$delimiter" '
|
sed -i "s|^$key\($delimiter\+\).*|$key\1$value_should|" "$file"
|
||||||
/${key}${delimiter}*/{gsub("$value_is", "$value_should")};{print}' "$file" > "${file}+" \
|
|
||||||
&& mv "${file}+" "$file"
|
|
||||||
|
|
||||||
DONE
|
DONE
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue