add a hopefully more robust implementation for changing existing values

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2012-02-03 20:50:17 +01:00
parent 23eba4c5e1
commit 85f7880c7e

View file

@ -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
;;