bash: rgi verbessert
This commit is contained in:
parent
a7e54e50a8
commit
e7996e5dae
1 changed files with 18 additions and 0 deletions
|
@ -69,4 +69,22 @@ function rgf {
|
|||
fi
|
||||
fi
|
||||
}
|
||||
function rgi {
|
||||
if [[ "$1" == "--help" ]]; then
|
||||
echo "Finde alle Dateien die "\$1" im Inhalt haben."
|
||||
echo "rgi"
|
||||
echo "rgi <string>"
|
||||
else
|
||||
if [ -z "$1" ]; then
|
||||
echo "Suchbegriff fehlt..."
|
||||
else
|
||||
if [[ $(which rg) ]]; then
|
||||
rg -i "$1"
|
||||
else
|
||||
echo "ripgrep ist nicht installiert... suche mit 'grep'"
|
||||
grep -r -n -i "$1" .
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue