Fix fd on ubuntu/debian

This commit is contained in:
crater2150 2023-12-14 16:56:10 +01:00
parent b578fc04d9
commit 16e5256542

View file

@ -16,13 +16,17 @@ alias 7zu="7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
alias cronmail="mutt -f $MAIL" alias cronmail="mutt -f $MAIL"
if ! command -v fd >/dev/null; then if ! command -v fd >/dev/null; then
fd() { if command -v fdfind >/dev/null; then
if [[ "$1" =~ "-*" ]]; then alias fd="fdfind"
echo "fd not installed. shell alias supports only basic operation" else
return 1 fd() {
fi if [[ "$1" =~ "^-" ]]; then
noglob find . -iname "*${*}*" echo "fd not installed. shell alias supports only basic operation"
} return 1
fi
noglob find . -iname "*${*}*"
}
fi
fi fi
alias sudo="sudo " alias sudo="sudo "
@ -159,7 +163,7 @@ prenumbering() {
for i in "$@"; do for i in "$@"; do
mv $i ${(l:2::0:)n}_$i; mv $i ${(l:2::0:)n}_$i;
((n++)); ((n++));
done done
} }
# appends given suffix (first argument) # appends given suffix (first argument)