Skip to content

Instantly share code, notes, and snippets.

@tnga
Created May 26, 2019 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnga/abe9703ffb6b5736b5614f1d9f7c8e2c to your computer and use it in GitHub Desktop.
Save tnga/abe9703ffb6b5736b5614f1d9f7c8e2c to your computer and use it in GitHub Desktop.
A script for deeply process mmv task.
#!/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