aboutsummaryrefslogtreecommitdiff
path: root/base/pr-passive
diff options
context:
space:
mode:
authorAdam Hovorka <[email protected]>2018-09-30 20:36:27 -0600
committerAdam Hovorka <[email protected]>2018-09-30 20:36:27 -0600
commit9c1224578330135406ddc9f461184ff1f6756c0c (patch)
tree0afbaceff14b98919c04048bdf5d11a5a850289c /base/pr-passive
parentfc7fc47c946f49040df60dc3e3c4499399975125 (diff)
Add some more random utilities/functions
Diffstat (limited to 'base/pr-passive')
-rwxr-xr-xbase/pr-passive68
1 files changed, 68 insertions, 0 deletions
diff --git a/base/pr-passive b/base/pr-passive
new file mode 100755
index 0000000..e95c70c
--- /dev/null
+++ b/base/pr-passive
@@ -0,0 +1,68 @@
+#!/usr/bin/env bash
+
+# Abuse of the passive voice
+# 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"
+
+if [ "$1" = "" ]; then
+ echo "Usage: `basename $0` <file> ..."
+ exit
+fi
+
+egrep -n -i --color \
+ "\\b(am|are|were|being|is|been|was|be)\
+\\b[ ]*(\w+ed|($irregulars))\\b" $*
+
+exit $?