Created
May 31, 2018 07:43
-
-
Save bluecookies/1d9054ce77c2631d91cdbe865c7c72bf to your computer and use it in GitHub Desktop.
folder merger
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
| if [ $# -ne 2 ]; then | |
| echo "merge src patch" | |
| exit 1 | |
| fi | |
| num=$(ls -1q $1 | wc -l) | |
| extra=$(ls -1q $2 | wc -l) | |
| for x in $(seq 0 $((extra - 1))); do | |
| f=$2/$x.jpg | |
| if [ -f $f ]; then | |
| # echo "$f >> $1/$((num + x)).jpg" | |
| mv $f "$1/$((num + x)).jpg" | |
| else | |
| echo "Error: $f does not exist!" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment