Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- for dir in * ; do
- for json_file in $dir/*.json ; do
- rating=$(cat $json_file | jq '.rating' | tr -d '"')
- img_filename=$(basename $(cat $json_file | jq '.file_url' | tr -d '"'))
- img_path=$dir/$img_filename
- echo $img_path $rating
- if [ "$rating" = "s" ]; then
- echo $img_path is safe
- else
- rm -v $img_path
- rm -v $json_file
- fi
- done
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement