generalise clean_images.sh to deal with any file type
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/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
|
# script for looping through each file in a directory, opening it with mimeopen, and upon the closing of the file viewer, asking the user whether or not to delete the image, and deleting if "y" received
|
||||||
|
|
||||||
for file in *
|
for file in *
|
||||||
do
|
do
|
||||||
pqiv "$file" || rm "$file" && read -p "Delete file? [y/n]: " ans && [ "$ans" = "y" ] && rm "$file"
|
mimeopen "$file" && read -p "Delete file? [y/n]: " ans && [ "$ans" = "y" ] && rm "$file"
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user