scripts

My personal collection of scripts
git clone git://src.gearsix.net/scripts
Log | Files | Refs | Atom | README | LICENSE

bulk-rename.sh (248B)


      1 #!/usr/bin/env sh
      2 # renames all *toml, *json, *yaml files in content to */meta.{toml,json,yaml}
      3 
      4 for f in $(find $1 -name *toml -o -name *json -o -name *yaml); do
      5 	oldn=$(basename $f ${f:(-5):5})
      6 	newn=${f/\/$oldn./\/meta.}
      7 	echo "$f -> $newn"
      8 done