From 916594e20ba871b45599bf07a5269e1f57cbfc48 Mon Sep 17 00:00:00 2001 From: anon Date: Tue, 10 Dec 2024 20:39:02 +0100 Subject: [PATCH] Added 'Misc./script_help_for_xolatile.sh' --- Misc./script_help_for_xolatile.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 Misc./script_help_for_xolatile.sh diff --git a/Misc./script_help_for_xolatile.sh b/Misc./script_help_for_xolatile.sh new file mode 100755 index 0000000..609e084 --- /dev/null +++ b/Misc./script_help_for_xolatile.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# NOTE: technically a find command is better, +# but this is much cleaner if you dont have thousands of files +# and or spaces in their names +shopt -s globstar +for i in **/*; do + DIM=$(identify $i | cut -d ' ' -f 3) + H=$(echo $DIM | cut -d x -f 1) + W=$(echo $DIM | cut -d x -f 2) + AREA=$(expr $H '*' $W) + echo "$i: $DIM $AREA" +done