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
|
||||
# change value
|
||||
cat << DONE
|
||||
awk -F "$delimiter" '
|
||||
/${key}${delimiter}*/{gsub("$value_is", "$value_should")};{print}' "$file" > "${file}+" \
|
||||
&& mv "${file}+" "$file"
|
||||
|
||||
sed -i "s|^$key\($delimiter\+\).*|$key\1$value_should|" "$file"
|
||||
DONE
|
||||
fi
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue