From f7fad2bd24617040d4addc7e5427b7f1e1b83054 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Thu, 7 Oct 2021 09:59:14 +0200 Subject: [PATCH] Make user get prompted if extracted file overwrites another file --- .local/bin/ext | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/ext b/.local/bin/ext index 9529d4a6..0f70fc26 100755 --- a/.local/bin/ext +++ b/.local/bin/ext @@ -15,7 +15,7 @@ esac done [ -z "$archives" ] && printf "Give archives to extract as argument.\\n" && exit 1 -while IFS= read -r file ; do +while IFS= read -r file <&3; do if [ -f "$file" ] ; then if [ -z "$extracthere" ]; then directory="$(echo "$file" | sed 's/\.[^\/.]*$//')" && @@ -42,4 +42,4 @@ while IFS= read -r file ; do else printf "File \"%s\" not found.\\n" "$file" fi -done <<< "$archives" +done 3<<< "$archives"