Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # pdfs.log in this case is the result of doing something like: find /a/directory/somewhere -name "*.pdf" > pdfs.log
- for file in $(cat pdfs.log) ; do
- if [ ! -h $file ] ; then
- echo "Checking for duplicates of: $file"
- file_basename=$(basename "$file")
- for duplicate in $(cat pdfs.log) ; do
- if [ ! -h $duplicate ] ; then
- if [ "$duplicate" != "$file" ] ; then
- if [ "$(basename $duplicate)" = "$file_basename" ] ; then
- cmp -s $duplicate $file
- if [ $? -eq 0 ] ; then
- echo "ln -sf $file $duplicate"
- ln -sf $file $duplicate
- fi
- fi
- fi
- fi
- done
- fi
- done
Add Comment
Please, Sign In to add comment