mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
Added search utility
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
parent
3f61d130f9
commit
f5b7b183d2
1 changed files with 16 additions and 0 deletions
16
bin/search
Executable file
16
bin/search
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
filter="$1"; shift;
|
||||
|
||||
grep=""
|
||||
for q in "$@" ; do
|
||||
list=-l
|
||||
if [ "TEST${q:0:1}" = "TEST-" ]; then
|
||||
list=-L
|
||||
q=${q:1}
|
||||
fi
|
||||
grep="$grep | xargs -0 -n10 grep --null $list -E \"$q\""
|
||||
|
||||
done;
|
||||
|
||||
eval "find -iname \"$filter\" -print0 $grep | tr '\0' '\n'"
|
||||
Loading…
Add table
Add a link
Reference in a new issue