- Cleaned up on-add.the example hook; now works with huge input without falling over.
This commit is contained in:
Wilhelm Schuermann 2014-10-02 20:31:24 +02:00 committed by Paul Beckingham
parent 1fa4c8ff7b
commit ffc456be88

View file

@ -2,18 +2,11 @@
read new_task
re='(.*)([Tt])eh(.*)'
if [[ $new_task =~ $re ]]
if (echo $new_task | grep -qE '[tT]eh');
then
while [[ $new_task =~ $re ]]
do
new_task=${BASH_REMATCH[1]}${BASH_REMATCH[2]}he${BASH_REMATCH[3]}
done
new_task=$(echo $new_task | sed -r 's/([tT])eh/\1he/g')
echo "Auto-corrected 'teh' --> 'the'"
fi
echo $new_task
exit 0