-
Notifications
You must be signed in to change notification settings - Fork 20
/
checktxt
executable file
·53 lines (50 loc) · 881 Bytes
/
checktxt
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
46
47
48
49
50
51
52
53
#! /bin/bash
# Checks text for known style faults
mistakes='
cafe
adhoc
chokehold
deadend
fibre
hightech
[0-9][0-9]s
sideeffect
smart.phone
timescale
20th
upfront
vs
vice-president
web.site
USD
EUR
JPY
whistle-blower
whistleblower
para-military
neighbour
colour
odour
the\sthe\s
'
for term in $mistakes; do
egrep --color " $term| ${term^}" ch*.txt
done
# Other poor constructions
egrep --color "^[^>].*, but " ch*.txt
egrep --color "^[^>].*[^,] but " ch*.txt
egrep --color " online" ch*.txt
egrep --color "todo" ch*.txt
egrep --color "\", " ch*.txt
egrep --color "\"\. " ch*.txt
egrep --color " - " ch*.txt
# Check length of paragraphs
for file in ch*.txt; do
line=0
for length in `awk '{print length}' $file`; do
let line=line+1
if [ $length -gt 777 ]; then
echo "$file:$line: line contains $length chars"
fi
done
done