[PATCH v2 02/10] base-files: upgrade: use stdin redirection to replace cat command

Yousong Zhou yszhou4tech at gmail.com
Mon Nov 9 21:22:15 EST 2020


Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 package/base-files/files/lib/upgrade/common.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index c4947e4624..e12dfc9678 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -91,7 +91,7 @@ get_image() { # <source> [ <command> ]
 		esac
 	fi
 
-	cat "$from" 2>/dev/null | $cmd
+	$cmd <"$from"
 }
 
 get_magic_word() {



More information about the openwrt-devel mailing list