From afd472cb30ba90611b3b3907ad2570f26905532c Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 28 Nov 2012 11:54:45 -0600 Subject: [PATCH] Don't combine sed options Combining '-i -e' into '-ie' changes behaviour, don't do that Change-Id: Ice46c6b4f899b4c76f355cc88241dd33bc60f459 --- functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions b/functions index 9dab759a3f..f2b12e21e2 100644 --- a/functions +++ b/functions @@ -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 }