Created
September 6, 2020 16:02
-
-
Save sugayaa/8d2cb55b05d5024370afce1cffeedfa1 to your computer and use it in GitHub Desktop.
made for appending image's dimensions to it's filename
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 | |
FILES=$(find -type f -exec basename {} \;) | |
for file in $FILES; do | |
dimensions=$(identify $file | awk '{print $3}') | |
name=$(echo $file | tr "." " " | awk '{print $1}') | |
extension=$(echo $file | tr "." " " | awk '{print $2}') | |
mv $file $name-$dimensions.$extension | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment