view scripts/removeWithSignature @ 114:d4e337567960

Add some debug statements and fix a bug in SQL execution.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Tue, 03 May 2016 02:26:39 +0200
parents 3951f6d27219
children
line wrap: on
line source

#!/bin/bash

FORCE=false
while getopts 'f' val
do
  case $val in
    f) FORCE=true ;;
    ?) exit 1;
  esac
done
let nopts=OPTIND-1
shift ${nopts}

if $FORCE
then
 command=rm
else
  command=echo
fi

TARGET=$1
shift

while [ -n "$1" ]
do
	~/projects/dedupe/scripts/duplicates.sh -s $TARGET | grep $1 | cut -d\| -f3- | xargs -d '\n' -n 1 $command
	shift
done