From cdbf9f642a131cd4e13f203bd51ea16030e410f3 Mon Sep 17 00:00:00 2001 From: deicidus Date: Thu, 8 Jun 2023 11:58:23 -0700 Subject: [PATCH] trying standard error output --- spells/cantrips/ask_yn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spells/cantrips/ask_yn b/spells/cantrips/ask_yn index 488af7b..fb6ef29 100755 --- a/spells/cantrips/ask_yn +++ b/spells/cantrips/ask_yn @@ -16,9 +16,9 @@ trap "printf '\n'; exit 2" 2 # Use stty to make read command work for single character input old_stty_cfg=$(stty -g) stty raw -echo -printf "%s" "$prompt" +printf "%s" "$prompt" >&2 answer=$( while ! head -c 1 | grep -i '[yn]'; do true; done ) -stty "$old_stty_cfg" +stty "$old_stty_cfg" >&2 # If no answer is given, use the default answer if [ -z "$answer" ]; then