comparison scripts/removeWithSignature @ 112:3951f6d27219

Add various useful scripts. Refactor out SQL-statements.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Tue, 03 May 2016 02:20:07 +0200
parents
children
comparison
equal deleted inserted replaced
111:9d9926a6011f 112:3951f6d27219
1 #!/bin/bash
2
3 FORCE=false
4 while getopts 'f' val
5 do
6 case $val in
7 f) FORCE=true ;;
8 ?) exit 1;
9 esac
10 done
11 let nopts=OPTIND-1
12 shift ${nopts}
13
14 if $FORCE
15 then
16 command=rm
17 else
18 command=echo
19 fi
20
21 TARGET=$1
22 shift
23
24 while [ -n "$1" ]
25 do
26 ~/projects/dedupe/scripts/duplicates.sh -s $TARGET | grep $1 | cut -d\| -f3- | xargs -d '\n' -n 1 $command
27 shift
28 done