专注各种脚本编程
Baidu
加入收藏夹
本站内容有下面分类知识,欢迎您的到来^_^
shell相关:指令篇 基础篇 脚本欣赏 编程实例 shell问问 shell视频教程 技巧篇 水平测试 E文资料 vi编辑器 高级Bash脚本编程指南
其他:mysql perl c语言 oracle
当前位置:| 主页>shell脚本欣赏>

一个查找字符的shell脚本

百度收藏 QQ搜藏

作者:777

源码
-----------------------------------------------------------------
#!/usr/local/bin/bash
#A bash script to find a keyword.
#Name findkey
while true;do
echo "Input directory: ( Will exit if you press e ! ) "
read dir
if [ $dir = "e" ];then echo "The process already exit !";exit 0;fi
if [ -e $dir ];then
echo -n "Input keyword: "
read "key"
grep -R "$key" $dir 2>/dev/null|less
else "The directory is not exist ! ";fi
done

上一篇:判断二进制文件是否相同 下一篇:改变系统启动运行等级的shell脚本

power by soyo123 2007-2008