Created
September 7, 2015 17:48
-
-
Save SammysHP/a7af929b4aea043b717d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| EXTENSION_RAW="ARW" | |
| filelist=$(sxiv -o "$@") | |
| if [[ -z $filelist ]]; then | |
| exit | |
| fi | |
| IFS=$'\n' | |
| echo "Files to be removed:" | |
| echo | |
| for filename in $filelist; do | |
| absname=$(realpath "$filename") | |
| rawname="${absname::-3}$EXTENSION_RAW" | |
| echo "rm '$absname'" | |
| echo "rm '$rawname'" | |
| done | |
| echo | |
| read -p "Really delete these files? (y/N): " -r | |
| if [[ $REPLY =~ ^[YyJj]$ ]]; then | |
| echo | |
| echo "Deleting files..." | |
| for filename in $filelist; do | |
| absname=$(realpath "$filename") | |
| rawname="${absname::-3}$EXTENSION_RAW" | |
| rm -v "$absname" | |
| rm -v "$rawname" | |
| done | |
| echo "done." | |
| fi | |
| unset IFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment