taskwarrior/scripts/hooks/on-add.the
Dustin J. Mitchell cf6c0254dc
Add shell quoting and 'read -r' in example hooks (#3905)
This helps to avoid interpretation of escape sequences, such as
backslash-escapes, in these values.

Patch provided by @bughunter2 in https://github.com/GothenburgBitFactory/taskwarrior/issues/3899.
2025-06-26 15:34:43 +02:00

12 lines
215 B
Bash

#!/usr/bin/env bash
read -r new_task
if (echo "$new_task" | grep -qE '[tT]eh');
then
new_task=$(echo "$new_task" | sed -r 's/([tT])eh/\1he/g')
echo "Auto-corrected 'teh' --> 'the'"
fi
echo "$new_task"
exit 0