[PATCH] tests: add extension to sed -i for GNU/BSD sed compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



From: Ed Maste <emaste@xxxxxxxxxxx>

BSD sed requires that an extension is provided to the -i (in-place edit)
flag, which may immediately follow the -i or may be separated by a space -
sed -i .bak and sed -i.bak are equivalent.  The extension is optional with
GNU sed, but if provided must immediately follow the -i.  Thus, sed -i.bak
behaves identically with both GNU and BSD sed.

Signed-off-by: Ed Maste <emaste@xxxxxxxxxxx>
---
 tests/run_tests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 00bd1b3..bc27a81 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -738,7 +738,7 @@ dtc_tests () {
 
     # Dependencies
     run_dtc_test -I dts -O dtb -o dependencies.test.dtb -d dependencies.test.d "$SRCDIR/dependencies.dts"
-    sed -i "s,$SRCDIR/,,g" dependencies.test.d
+    sed -i.bak "s,$SRCDIR/,,g" dependencies.test.d
     run_wrap_test cmp dependencies.test.d "$SRCDIR/dependencies.cmp"
 
     # Search paths
-- 
2.23.0




[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux