Created
February 27, 2016 19:59
-
-
Save andreadellacorte/9015635e97fcbbf577ed to your computer and use it in GitHub Desktop.
Find passive voice - usage: cat file.txt | ./grep-passive-voice.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# http://matt.might.net/articles/shell-scripts-for-passive-voice-weasel-words-duplicates/ | |
irregulars="awoken|\ | |
been|born|beat|\ | |
become|begun|bent|\ | |
beset|bet|bid|\ | |
bidden|bound|bitten|\ | |
bled|blown|broken|\ | |
bred|brought|broadcast|\ | |
built|burnt|burst|\ | |
bought|cast|caught|\ | |
chosen|clung|come|\ | |
cost|crept|cut|\ | |
dealt|dug|dived|\ | |
done|drawn|dreamt|\ | |
driven|drunk|eaten|fallen|\ | |
fed|felt|fought|found|\ | |
fit|fled|flung|flown|\ | |
forbidden|forgotten|\ | |
foregone|forgiven|\ | |
forsaken|frozen|\ | |
gotten|given|gone|\ | |
ground|grown|hung|\ | |
heard|hidden|hit|\ | |
held|hurt|kept|knelt|\ | |
knit|known|laid|led|\ | |
leapt|learnt|left|\ | |
lent|let|lain|lighted|\ | |
lost|made|meant|met|\ | |
misspelt|mistaken|mown|\ | |
overcome|overdone|overtaken|\ | |
overthrown|paid|pled|proven|\ | |
put|quit|read|rid|ridden|\ | |
rung|risen|run|sawn|said|\ | |
seen|sought|sold|sent|\ | |
set|sewn|shaken|shaven|\ | |
shorn|shed|shone|shod|\ | |
shot|shown|shrunk|shut|\ | |
sung|sunk|sat|slept|\ | |
slain|slid|slung|slit|\ | |
smitten|sown|spoken|sped|\ | |
spent|spilt|spun|spit|\ | |
split|spread|sprung|stood|\ | |
stolen|stuck|stung|stunk|\ | |
stridden|struck|strung|\ | |
striven|sworn|swept|\ | |
swollen|swum|swung|taken|\ | |
taught|torn|told|thought|\ | |
thrived|thrown|thrust|\ | |
trodden|understood|upheld|\ | |
upset|woken|worn|woven|\ | |
wed|wept|wound|won|\ | |
withheld|withstood|wrung|\ | |
written" | |
exec egrep -n -i --color \ | |
"\\b(am|are|were|being|is|been|was|be)\ | |
\\b[ ]*(\w+ed|($irregulars))\\b" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment