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