From e8b875ec5320319910b0966446631cfa8fc6d8ec Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 22 Jul 2021 11:40:21 +0200 Subject: dev: Workaround for trailing spaces in busybox xxd output --- modules/dev.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/dev.inc') diff --git a/modules/dev.inc b/modules/dev.inc index fcde631..3330741 100644 --- a/modules/dev.inc +++ b/modules/dev.inc @@ -205,9 +205,9 @@ __init() { local t # init __hex2bin t="7a32337465737431323374657374" - if [ "$( printf z23test123test | xxd -p )" = "$t" ]; then + if [ "$( printf z23test123test | xxd -p | tr -d '\n ' )" = "$t" ]; then #echo "Using xxd" >&2 - __bin2hex() { xxd -p; } + __bin2hex() { xxd -p | tr -d '\n '; } elif [ "$( printf z23test123test | od -t x1 -An | tr -d '\n ' )" = "$t" ]; then #echo "Using od" >&2 __bin2hex() { od -t x1 -An | tr -d '\n '; } -- cgit v1.2.3-55-g7522