Created
May 26, 2019 12:15
-
-
Save tnga/abe9703ffb6b5736b5614f1d9f7c8e2c to your computer and use it in GitHub Desktop.
A script for deeply process mmv task.
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 | |
# | |
# Description: | |
# A script for deeply process mmv task. | |
# NOTE: | |
# See `man mmv` command for more details | |
# | |
# version: 0.1.0 | |
# Legal Stuff: <https://www.gnu.org/licenses/gpl-3.0.txt> | |
# @tnga / © 2019 UMI.Lab | |
if [[ -z $1 || -z $2 ]] ; then | |
echo "missing parameters for mmv to use." | |
echo -e "e.g: \n mmv -vr \"*oldmark*\" \"#1newmark#2\"" | |
echo "see \`man mmv\` for more" | |
exit 1 | |
fi | |
MMV_PARAMS=$@ | |
_fetch_subdir () { | |
for element in $( ls ) ; do | |
if [ -d $element ] ; then | |
cd $element | |
_fetch_subdir | |
echo "--- `pwd`" | |
fi | |
done | |
mmv $MMV_PARAMS | |
cd .. | |
} | |
_fetch_subdir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment