A tool for sorting text and files by regex templates with support for recursion, nested categories, and custom delimiters.
git clone https://github.com/amn3zi4/prhook
cd prhook
chmod +x prhook.shcd prhook
sudo make installcd prhook
sudo make uninstall| Flag | Description |
|---|---|
-t, --template |
template file (required) |
-f, --file |
input file or directory |
-if, --input-format |
text or files (default: text) |
-of, --output-format |
text or files (default: text) |
-o, --output |
output directory (default: output) |
-s, --separator |
word separator (e.g. -s ,) |
-r, --recursive |
recursive directory processing |
-a, --add |
add to existing results |
-Da, --delete-add |
delete old files before adding |
-Se, --save-empty |
keep empty lines |
-h, --help |
show help |
- Odd lines → category names (folder names)
- Even lines → regex patterns for
grep -E -at the end of category → exclusion (grep -v)/for nested folders
ADMIN
admin|dashboard|console
API
api|graphql|v1
IGNORE_ADMIN -
test|dev|stage
cat examples/subdomains.txt | ./prhook.sh -t templates/critical_endpoints.txt
# Results in output/./prhook.sh -s "\. " -t templates/apples.txt -f examples/some_text.txt
# Results in output/some_text.txt/./prhook.sh -c -f examples/some_files/ -t templates/dates.txt
#results in output/See GUIDE.md for details.
MIT © amn3zi4