From 9f3d4a44c8da4a374b8c93765e296032102d8b67 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 16 Jul 2023 19:53:41 +0100 Subject: [PATCH] add clean_images.sh --- clean_images.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 clean_images.sh diff --git a/clean_images.sh b/clean_images.sh new file mode 100755 index 0000000..ec32ccb --- /dev/null +++ b/clean_images.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# script for looping through each image in a directory, displaying it with pqiv, and upon the closing of the image viewer, asking the user whether or not to delete the image, and deleting if "y" received + +for file in * +do + pqiv "$file" || rm "$file" && read -p "Delete file? [y/n]: " ans && [ "$ans" = "y" ] && rm "$file" +done