diff mbox series

[oe-layersetup,PATCHv2,10/16] oe-layertool-setup: use subshell execution with redirect

Message ID 20230614034507.598391-11-res.sapp@gmail.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series Sacrifice your first born to the linter | expand

Commit Message

Res Sapp June 14, 2023, 3:45 a.m. UTC
Shellcheck:
Consider using { cmd1; cmd2; } >> file instead of individual redirects.

Signed-off-by: Randolph Sapp <res.sapp@gmail.com>
---
 oe-layertool-setup.sh | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh
index b824114..8e29f9a 100755
--- a/oe-layertool-setup.sh
+++ b/oe-layertool-setup.sh
@@ -818,16 +818,18 @@  EOM
 
     if [ -e "$oebase/tmp_append_local.conf" ]
     then
-        echo "" >> "$confdir/local.conf"
-        echo "#====================================================================" >> "$confdir/local.conf"
-        echo "# LOCALCONF: settings from config file:" >> "$confdir/local.conf"
-        echo "#   $inputfile" >> "$confdir/local.conf"
-        echo "#" >> "$confdir/local.conf"
-        echo "# Do not remove." >> "$confdir/local.conf"
-        echo "#--------------------------------------------------------------------" >> "$confdir/local.conf"
-        cat "$oebase/tmp_append_local.conf" >> "$confdir/local.conf"
-        echo "#====================================================================" >> "$confdir/local.conf"
-        echo "" >>  "$confdir/local.conf"
+        {
+            echo "";
+            echo "#====================================================================";
+            echo "# LOCALCONF: settings from config file:";
+            echo "#   $inputfile";
+            echo "#";
+            echo "# Do not remove.";
+            echo "#--------------------------------------------------------------------";
+            cat "$oebase/tmp_append_local.conf";
+            echo "#====================================================================";
+            echo "";
+        } >> "$confdir/local.conf"
         rm "$oebase/tmp_append_local.conf"
     fi
 }