Created
November 30, 2017 13:52
-
-
Save settermjd/0d3797ffa811a5d4ebb7c21ba2b736a7 to your computer and use it in GitHub Desktop.
Find images whose width is greater than X
This file contains 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 | |
set -e | |
# Set the width from the first argument (could do this with getopts). | |
width=$1 | |
# Filter the images using a combination of file and awk. | |
file images/* | awk -v width="$width" '{ if ($5 > width) print $1 }' | tr -d ':' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment