From 590d75096fa0a7503784584598c8362626bea846 Mon Sep 17 00:00:00 2001 From: William Melody Date: Fri, 11 Sep 2015 19:47:52 -0700 Subject: [PATCH] Print confirmation feedback in `add` on success. --- hosts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hosts b/hosts index 893f05b..ebc8d19 100755 --- a/hosts +++ b/hosts @@ -685,10 +685,17 @@ add() { "${ip}" \ "${hostname}" \ "${formatted_comment}" >> "${HOSTS_PATH}" + printf "Added:\n%s\t%s\t# %s\n" \ + "${ip}" \ + "${hostname}" \ + "${formatted_comment}" else printf "%s\t%s\n" \ "${ip}" \ "${hostname}" >> "${HOSTS_PATH}" + printf "Added:\n%s\t%s\n" \ + "${ip}" \ + "${hostname}" fi fi }