bash: rgi/rgf
This commit is contained in:
parent
977501b0df
commit
7aff4c5a52
1 changed files with 6 additions and 6 deletions
12
.bash_extra
12
.bash_extra
|
@ -91,13 +91,13 @@ function rgf {
|
|||
echo "Finde alle Dateien die "\$1" im Namen haben."
|
||||
echo ""
|
||||
echo " Usage: rgf <string>"
|
||||
exit
|
||||
return 0
|
||||
fi
|
||||
if [ -z "$1" ]; then
|
||||
echo "Suchbegriff fehlt..."
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
if command -v "ripgrep" &> /dev/null; then
|
||||
if command -v rg >/dev/null ; then
|
||||
rg --files -g *"$1"* --hidden
|
||||
else
|
||||
echo "ripgrep ist nicht installiert... suche mit 'find'"
|
||||
|
@ -109,13 +109,13 @@ function rgi {
|
|||
echo "Finde alle Dateien die "\$1" im Inhalt haben."
|
||||
echo ""
|
||||
echo " Usage: rgi <string>"
|
||||
exit
|
||||
return 0
|
||||
fi
|
||||
if [ -z "$1" ]; then
|
||||
echo "Suchbegriff fehlt..."
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
if command -v "ripgrep" &> /dev/null; then
|
||||
if command -v rg >/dev/null ; then
|
||||
rg -i "$1"
|
||||
else
|
||||
echo "ripgrep ist nicht installiert... suche mit 'grep'"
|
||||
|
|
Loading…
Reference in a new issue