Don't combine sed options

Combining '-i -e' into '-ie' changes behaviour, don't do that

Change-Id: Ice46c6b4f899b4c76f355cc88241dd33bc60f459
This commit is contained in:
Dean Troyer 2012-11-28 11:54:45 -06:00
parent e509d9cde7
commit afd472cb30

View File

@ -419,7 +419,7 @@ function inicomment() {
local file=$1
local section=$2
local option=$3
sed -ie "/^\[ *$section *\]/,/^\[.*\]/ s|^\($option[ \t]*=.*$\)|#\1|" $file
sed -i -e "/^\[ *$section *\]/,/^\[.*\]/ s|^\($option[ \t]*=.*$\)|#\1|" $file
}
# Uncomment an option in an INI file
@ -428,7 +428,7 @@ function iniuncomment() {
local file=$1
local section=$2
local option=$3
sed -ie "/^\[ *$section *\]/,/^\[.*\]/ s|[^ \t]*#[ \t]*\($option[ \t]*=.*$\)|\1|" $file
sed -i -e "/^\[ *$section *\]/,/^\[.*\]/ s|[^ \t]*#[ \t]*\($option[ \t]*=.*$\)|\1|" $file
}
@ -457,12 +457,12 @@ function iniset() {
fi
if [[ -z "$(iniget $file $section $option)" ]]; then
# Add it
sed -ie "/^\[ *$section *\]/ a\\
sed -i -e "/^\[ *$section *\]/ a\\
$option = $value
" $file
else
# Replace it
sed -ie "/^\[ *$section *\]/,/^\[.*\]/ s|^\($option[ \t]*=[ \t]*\).*$|\1$value|" $file
sed -i -e "/^\[ *$section *\]/,/^\[.*\]/ s|^\($option[ \t]*=[ \t]*\).*$|\1$value|" $file
fi
}