Skip to content

Instantly share code, notes, and snippets.

@bluecookies
Created May 31, 2018 07:43
Show Gist options
  • Select an option

  • Save bluecookies/1d9054ce77c2631d91cdbe865c7c72bf to your computer and use it in GitHub Desktop.

Select an option

Save bluecookies/1d9054ce77c2631d91cdbe865c7c72bf to your computer and use it in GitHub Desktop.
folder merger
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