[openwrt/openwrt] base-files: upgrade: use stdin redirection to replace cat command

LEDE Commits lede-commits at lists.infradead.org
Wed Nov 11 10:47:03 EST 2020


yousong pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bd21e4a93617a6609725509c67dc293242c80f97

commit bd21e4a93617a6609725509c67dc293242c80f97
Author: Yousong Zhou <yszhou4tech at gmail.com>
AuthorDate: Tue Nov 3 11:26:21 2020 +0800

    base-files: upgrade: use stdin redirection to replace cat command
    
    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 0f25199365..5eb7b23a83 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -103,7 +103,7 @@ get_image() { # <source> [ <command> ]
 		esac
 	fi
 
-	cat "$from" 2>/dev/null | $cmd
+	$cmd <"$from"
 }
 
 get_magic_word() {



More information about the lede-commits mailing list