From ab8934ae809231b53486a1176c3faabf286959a4 Mon Sep 17 00:00:00 2001 From: William Melody Date: Tue, 15 Sep 2015 11:30:30 -0700 Subject: [PATCH] Default to 'N' in `remove` confirmation. Rather than require a response, use 'N' as the default since this is a destructive action. --- hosts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hosts b/hosts index 65a9004..76b2a3d 100755 --- a/hosts +++ b/hosts @@ -999,18 +999,15 @@ remove() { printf "Removing the following records:\n%s\n" "$target_records" while true do - read -p "Are you sure you want to proceed? [y/n] " yn + read -p "Are you sure you want to proceed? [y/N] " yn case $yn in [Yy]* ) break ;; - [Nn]* ) + * ) printf "Exiting...\n" exit 0 ;; - * ) - printf "Please answer yes or no.\n" - ;; esac done fi