Code: Select all
#!/bin/bash
#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
p=$(find -name 'ckpetworkng' 2> /dev/null | wc -l)
if [[ "$p" == "0" ]] ; then echo
p=""
while [[ 1 ]]
do read p
if [[ "$p" == "" ]] ; then break ; fi
echo --------------------------------------------------------------------------------
echo "$p"
echo
sudo rm -rf ckpetworkng 2> /dev/null
sudo mkdir ckpetworkng
cd ckpetworkng
sudo tar -xf "../$p" 2> /dev/null
find -exec file '{}' \; 2> /dev/null | sed "s/\:/\n\:/g" | grep "\:" | sort | uniq -c
cd ..
done
sudo rm -rf ckpetworkng 2> /dev/null
else echo "file or folder ckpetworkng found; quitting..."
echo '(ckpetworkng is used as a working folder, then rm rfd)' ; fi
find . -name '*.pet' | ckpet