Add tgrep function
This commit is contained in:
parent
ff4015bb5e
commit
689d81e68f
1 changed files with 8 additions and 0 deletions
8
bashrc.d/tgrep_function
Executable file
8
bashrc.d/tgrep_function
Executable 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}"
|
||||||
|
}
|
Loading…
Reference in a new issue