Skip to content

Instantly share code, notes, and snippets.

@sennajox
Created April 19, 2013 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sennajox/5419720 to your computer and use it in GitHub Desktop.
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)
#!/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