#!/bin/bash # This program removes all wide picture files from a directory for file in * do #echo $file width=`identify $file | awk '{print $3}' | awk -Fx '{print $1}'` length=`identify $file | awk '{print $3}' | awk -Fx '{print $2}'|awk -F+ '{print $1}'` #echo "width - $width" #echo "length - $length" if [ "$width" -gt "$length" ] then echo "removing $file" #rm $file else #echo "$file is a keeper" : fi echo "" done