Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -e
- if [[ ! -d $1 ]]; then
- echo "usage: $0 DIR"
- exit 1;
- fi
- mkdir -p /tmp/tmp$$
- for dir in $1/*; do
- if [[ ! -d $dir ]]; then
- continue
- fi
- for jpg in $dir/*.jpg; do
- mv $jpg /tmp/tmp$$/$(basename $dir)_$(basename $jpg)
- done
- rmdir $dir
- done
- mv /tmp/tmp$$ JPEG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement