From 5094f35d05664fcf2819e9665110298bbac867cf Mon Sep 17 00:00:00 2001 From: "Brock A. Martin" Date: Tue, 26 Jul 2016 07:21:04 -0500 Subject: [PATCH] switched out 'head' for 'dd' in order to do chunking --- asc2qr.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asc2qr.sh b/asc2qr.sh index 2f0fe02..708d869 100755 --- a/asc2qr.sh +++ b/asc2qr.sh @@ -48,13 +48,13 @@ fi ## Split the key file into usable chunks that the QR encoder can consume chunks=() while true; do - s=$( head -c ${max_qr_bytes} ) + s=$( dd bs=${max_qr_bytes} count=1 2>/dev/null ) if [ ${#s} -gt 0 ]; then chunks+=("${s}") else break fi -done <<< "$( cat ${asc_key} )" +done < ${asc_key} ## For each chunk, encode it into a qr image index=1