-
Notifications
You must be signed in to change notification settings - Fork 1
/
old_check-dubious.sh
46 lines (29 loc) · 921 Bytes
/
old_check-dubious.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
### This script is part of the FLUX Toolchain project (https://github.com/adbar/flux-toolchain).
### Copyright (C) Adrien Barbaresi, 2012.
### The FLUX Toolchain is freely available under the GNU GPL v3 license (http://www.gnu.org/licenses/gpl.html).
# Create a temporary file
tempfile() {
tempprefix=$(basename "$0")
mktemp /tmp/${tempprefix}.XXXXXX
}
TMP1=$(tempfile)
trap 'rm -f $TMP1' EXIT
# sort
cut -f1 TO-CHECK | sort | uniq > $TMP1
mv $TMP1 BEING-CHECKED
## http://stackoverflow.com/questions/8314499/read-n-lines-at-a-time-using-bash
# Create new file handle 5
exec 5< BEING-CHECKED
# Now you can use "<&5" to read from this file
while read line1 <&5 ; do
read line2 <&5
python langid.py -u $line1 >> CHECKED &
python langid.py -u $line2 >> CHECKED &
wait
done
# Close file handle 5
exec 5<&-
# check CHECKED
perl check-dubious.pl
sort CHECKED-FILTERED | uniq >> RESULTS