From ca2e518a789cf62b1a0e810a4c6ca57931e7def0 Mon Sep 17 00:00:00 2001 From: Vlad Doster Date: Fri, 10 Apr 2020 15:43:49 -0500 Subject: [PATCH] Fixed bug in final output logic --- .local/bin/delete_certain_known_hosts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.local/bin/delete_certain_known_hosts b/.local/bin/delete_certain_known_hosts index c054c75a..5ea5772e 100755 --- a/.local/bin/delete_certain_known_hosts +++ b/.local/bin/delete_certain_known_hosts @@ -25,8 +25,7 @@ done # Output information to user about what happened if [[ -z "$lines_to_delete" ]]; then echo "All arguments passed were invalid lines in $known_hosts_path" -elif [[ -n "$string" ]]; then +else sed -i "$lines_to_delete" "$known_hosts_path" - echo "Deleted lines $(echo $(echo $lines_to_delete | sed 's/d;/, /g') | sed 's/.$//' )" + echo "Deleted lines $(echo $(echo "$lines_to_delete" | sed 's/d;/, /g') | sed 's/.$//' )" fi -