Browse code

Don't combine sed options

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

Change-Id: Ice46c6b4f899b4c76f355cc88241dd33bc60f459

Dean Troyer authored on 2012/11/29 02:54:45
Showing 1 changed files
... ...
@@ -419,7 +419,7 @@ function inicomment() {
419 419
     local file=$1
420 420
     local section=$2
421 421
     local option=$3
422
-    sed -ie "/^\[ *$section *\]/,/^\[.*\]/ s|^\($option[ \t]*=.*$\)|#\1|" $file
422
+    sed -i -e "/^\[ *$section *\]/,/^\[.*\]/ s|^\($option[ \t]*=.*$\)|#\1|" $file
423 423
 }
424 424
 
425 425
 # Uncomment an option in an INI file
... ...
@@ -428,7 +428,7 @@ function iniuncomment() {
428 428
     local file=$1
429 429
     local section=$2
430 430
     local option=$3
431
-    sed -ie "/^\[ *$section *\]/,/^\[.*\]/ s|[^ \t]*#[ \t]*\($option[ \t]*=.*$\)|\1|" $file
431
+    sed -i -e "/^\[ *$section *\]/,/^\[.*\]/ s|[^ \t]*#[ \t]*\($option[ \t]*=.*$\)|\1|" $file
432 432
 }
433 433
 
434 434
 
... ...
@@ -457,12 +457,12 @@ function iniset() {
457 457
     fi
458 458
     if [[ -z "$(iniget $file $section $option)" ]]; then
459 459
         # Add it
460
-        sed -ie "/^\[ *$section *\]/ a\\
460
+        sed -i -e "/^\[ *$section *\]/ a\\
461 461
 $option = $value
462 462
 " $file
463 463
     else
464 464
         # Replace it
465
-        sed -ie "/^\[ *$section *\]/,/^\[.*\]/ s|^\($option[ \t]*=[ \t]*\).*$|\1$value|" $file
465
+        sed -i -e "/^\[ *$section *\]/,/^\[.*\]/ s|^\($option[ \t]*=[ \t]*\).*$|\1$value|" $file
466 466
     fi
467 467
 }
468 468