Created
April 19, 2013 11:16
-
-
Save sennajox/5419720 to your computer and use it in GitHub Desktop.
A simple script for checking whether the deleted files still in existed_list(mayby recover)
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
#!/bin/bash | |
if [ $# -lt 2 ];then | |
echo "usage:$0 deleted_list existed_list" | |
exit 1 | |
fi | |
deleted_list=$1 | |
existed_list=$2 | |
if [ ! -f "$deleted_list" ];then | |
echo "$deleted_list is not existed" | |
exit 1 | |
fi | |
if [ ! -f "$existed_list" ];then | |
echo "$existed_list is not existed" | |
exit 1 | |
fi | |
while read line | |
do | |
#echo $line | |
count=`grep "$line$" $existed_list | wc -l` | |
if [ $count -eq 0 ];then | |
echo $line | |
fi | |
done < $deleted_list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment