Created
September 21, 2020 05:12
-
-
Save jp7fkf/a54cf6a4b32b7a649ef75a84415560ea to your computer and use it in GitHub Desktop.
This file contains 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 | |
if [ $# != 1 ]; then | |
echo "[ERROR] Please input directory path for garber." | |
exit -1 | |
fi | |
cd $1 | |
for a in * | |
do | |
b=`echo ${a} | sed -E 's/(.*)-([BF]|Edge).(Cu|Mask|SilkS|Cuts)(\.[A-z0-9]{3})/\1\4/g'` | |
echo "[INFO] mv $a to $b" | |
mv -f ${a} ${b} | |
if [ ${b##*.} = "gm1" ]; then | |
echo "[INFO] Convert '.gm1' to '.gml'" | |
mv -f ${b} `basename ${b} .gm1`.gml | |
fi | |
done | |
for a in *.drl | |
do | |
mv ${a} `basename ${a} .drl`.txt | |
echo "[INFO] mv $a to `basename ${a} .drl`.txt" | |
done | |
echo [INFO] Compressing as zip. | |
zip -r ${PWD##*/}.zip . | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment