Add tgrep function

This commit is contained in:
Antonio J. Delgado 2024-02-24 18:34:01 +02:00
parent ff4015bb5e
commit 689d81e68f

8
bashrc.d/tgrep_function Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
function tgrep() {
if [ ${#} -ne 2 ]; then
echo "First argument is a file, second argument a regexp to filter it while tailing"
exit 1
fi
tail -f "${1}" | grep -E "${2}"
}