bash: rgi/rgf angepasst
This commit is contained in:
parent
39d7a75030
commit
977501b0df
1 changed files with 24 additions and 24 deletions
28
.bash_extra
28
.bash_extra
|
@ -89,38 +89,38 @@ function psk {
|
|||
function rgf {
|
||||
if [[ "$1" == "--help" ]]; then
|
||||
echo "Finde alle Dateien die "\$1" im Namen haben."
|
||||
echo "rgf"
|
||||
echo "rgf <string>"
|
||||
else
|
||||
echo ""
|
||||
echo " Usage: rgf <string>"
|
||||
exit
|
||||
fi
|
||||
if [ -z "$1" ]; then
|
||||
echo "Suchbegriff fehlt..."
|
||||
else
|
||||
if [[ $(which rg &> /dev/null) ]]; then
|
||||
exit 1
|
||||
fi
|
||||
if command -v "ripgrep" &> /dev/null; then
|
||||
rg --files -g *"$1"* --hidden
|
||||
else
|
||||
echo "ripgrep ist nicht installiert... suche mit 'find'"
|
||||
find . -type f -name *"$1"*
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
function rgi {
|
||||
if [[ "$1" == "--help" ]]; then
|
||||
echo "Finde alle Dateien die "\$1" im Inhalt haben."
|
||||
echo "rgi"
|
||||
echo "rgi <string>"
|
||||
else
|
||||
echo ""
|
||||
echo " Usage: rgi <string>"
|
||||
exit
|
||||
fi
|
||||
if [ -z "$1" ]; then
|
||||
echo "Suchbegriff fehlt..."
|
||||
else
|
||||
if [[ $(which rg &> /dev/null) ]]; then
|
||||
exit 1
|
||||
fi
|
||||
if command -v "ripgrep" &> /dev/null; then
|
||||
rg -i "$1"
|
||||
else
|
||||
echo "ripgrep ist nicht installiert... suche mit 'grep'"
|
||||
grep -r -n -i "$1" .
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
function ssh {
|
||||
# benennt das aktuelle tmux-windows nach dem ssh-ziel
|
||||
|
|
Loading…
Reference in a new issue