Created
May 15, 2017 08:10
-
-
Save AquariusPower/871e5f81c5b2be700fe3d0c1dc120c91 to your computer and use it in GitHub Desktop.
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 | |
strExt="png" | |
function FUNCconv() { | |
local lstrFile="$1" | |
lstrFileWebp="${lstrFile%.$strExt}.webp" | |
if [[ ! -f "$lstrFileWebp" ]];then | |
echo | |
echo ">>> working with $lstrFile <-> $lstrFileWebp" | |
cwebp -q 80 "$lstrFile" -o "$lstrFileWebp" | |
ls -l "$lstrFile" "$lstrFileWebp" | |
else | |
echo ">>> found $lstrFileWebp" | |
fi | |
};export -f FUNCconv | |
find ./ -iname "*.${strExt}" -exec bash -c "FUNCconv '{}'" \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment