base-files: upgrade: use stdin redirection to replace cat command
authorYousong Zhou <yszhou4tech@gmail.com>
Tue, 3 Nov 2020 03:26:21 +0000 (11:26 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Wed, 11 Nov 2020 13:29:55 +0000 (21:29 +0800)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
package/base-files/files/lib/upgrade/common.sh

index 0f251993652f1be254847dcfc8573d28e47acde4..5eb7b23a830791136b7899145b16a6cd2be49cd5 100644 (file)
@@ -103,7 +103,7 @@ get_image() { # <source> [ <command> ]
                esac
        fi
 
-       cat "$from" 2>/dev/null | $cmd
+       $cmd <"$from"
 }
 
 get_magic_word() {