From 96656e3da8f52ccf6af8352021a1103fb8f328ce Mon Sep 17 00:00:00 2001 From: Fredrik Foss-Indrehus Date: Wed, 27 May 2026 14:42:57 +0200 Subject: [PATCH] clarify dd block sizes Use bs=1 when reading single-byte blocks with dd. This better expresses the intent of copying one byte at a time. --- pa | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pa b/pa index a6df447..7afb9c3 100755 --- a/pa +++ b/pa @@ -134,7 +134,7 @@ rand_chars() { # # $1 = number of chars to receive # $2 = filter for the chars - LC_ALL=C tr -dc "$2" /dev/null + LC_ALL=C tr -dc "$2" /dev/null } yn() { @@ -146,7 +146,7 @@ yn() { # Read a single byte from stdin using 'dd'. POSIX 'read' has # no support for single/'N' byte based input from the user. - answer=$(dd ibs=1 count=1 2>/dev/null) + answer=$(dd bs=1 count=1 2>/dev/null) # Disable raw input, leaving the terminal how we *should* # have found it.