Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15177430
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类:

2008-05-03 10:41:38

作者:777

源码
-----------------------------------------------------------------
#!/usr/local/bin/bash
#A 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
阅读(1731) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~