Bash scripting 11 – ExifTool menu

I have created a very rough and basic script to :-

# https://www.baeldung.com/linux/shell-script-simple-select-menu
#!/bin/bash
clear # clear display - lets keep things tidy
ls *.png *.JPG #display directory listing png files
echo
echo "Please enter a filename"
echo
read filename
echo "File: " $filename
echo
echo "Menu"
echo
PS3="Select your Option: "

while true; do
    select lng in All ImageSize FileSize PixelSize ClearScreen Quit
    do
        case $lng in
            
            "All")
                exiftool $filename; break;;
            "ImageSize")
               exiftool -s -ImageSize $filename; break;;
            "FileSize")
              exiftool -s -FileSize $filename;break;;
            "PixelSize")
                exiftool -s -Megapixels $filename;break;;
            "ClearScreen")
                clear;break;;
            "Quit")
               echo "We're done"; break 2;;
            *)
               echo "Ooops"; break ;;
        esac
    done
done

It is a little rough around the edges, but it works, and there is, of course, room for improvement.

Tags

#Bash,#Bashscripting,#ExifToolMenu,#MetaData


MastodonPeertubeJoin Mastodon

AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay