#!/bin/sh
# lazy find
# GNU All-Permissive License
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
## help function
function helpu {
echo " "
echo "Fuzzy search for filename."
echo "$0[--match-case|--path] filename"
echo " "
exit
}
## set variables
MATCH="-iname"
SEARCH="."
## parse options
while [ True ]; do
if [ "$1" = "--help" -o "$1" = "-h" ]; then
helpu
elif [ "$1" = "--match-case" -o "$1" = "-m" ]; then
MATCH="-name"
shift 1
elif [ "$1" = "--path" -o "$1" = "-p" ]; then
SEARCH="${2}"
shift 2
else
break
fi
done
## sanitize input filenames
## create array, retain spaces
ARG=( "${@}" )
set -e
## catch obvious input error
if [ "X$ARG" = "X" ]; then
helpu
fi
## perform search
for query in ${ARG[*]}; do
/usr/bin/find "${SEARCH}" "${MATCH}" "*${ARG}*" | grep --color=always "${ARG}"
done
没有合适的资源?快使用搜索试试~ 我知道了~
模糊搜索:ff+关键字
共2个文件
sh:1个
png:1个
需积分: 5 0 下载量 62 浏览量
2024-03-07
16:19:38
上传
评论
收藏 37KB ZIP 举报
温馨提示
模糊搜索:ff+关键字
资源推荐
资源详情
资源评论
收起资源包目录
ff模糊搜索.zip (2个子文件)
说明.png 36KB
search.sh 1KB
共 2 条
- 1
资源评论
崇志广勤
- 粉丝: 227
- 资源: 39
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功